modula2 testsuite: new libc unit test
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr77555.C
blob540d1a09a5fa77f7c3a434ce1bcfb832f2b5bd19
1 // { dg-do link }
2 // { dg-options "-std=c++11" }
4 extern "C" int printf(const char*, ...);
5 struct A {
6   A(int, char *p2) { printf(p2); }
7 };
8 template <int, typename> struct B { static A static_var; };
9 template <int LINE, typename GETTER>
10 A B<LINE, GETTER>::static_var{0, GETTER::get()};
11 struct C {
12   void unused() {
13     static char function_static;
14     struct D {
15       static char *get() { return &function_static; }
16     };
17     auto addr = B<0, D>::static_var;
18   }
20 int main() {}