Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / ext / visibility / anon8.C
blob8ef8d682336512e7e8d6563ee5bd8940cfa3eaaa
1 // PR c++/34213
2 // { dg-do compile }
4 template <void (*fn) ()>
5 void call ()                    // { dg-message "note" }
7   fn ();
10 namespace
12   struct B1
13   {
14     static void fn1 () {}
15     static void fn4 ();
16   };
17   void fn3 () {}
18   void B1::fn4 () {}
19   static void fn5 () {}
22 int main ()
24   struct B2
25   {
26     static void fn2 () {}
27   };
28   call<&B1::fn1> ();
29   call<&B2::fn2> ();    // { dg-error "not external linkage|no matching" }
30   // { dg-message "candidate" "candidate note" { target *-*-* } 29 }
31   call<&fn3> ();
32   call<&B1::fn4> ();
33   call<&fn5> ();        // { dg-error "not external linkage|no matching" }
34   // { dg-message "candidate" "candidate note" { target *-*-* } 33 }