summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/visibility/anon8.C
blob: 8ef8d682336512e7e8d6563ee5bd8940cfa3eaaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// PR c++/34213
// { dg-do compile }

template <void (*fn) ()>
void call ()			// { dg-message "note" }
{
  fn ();
}

namespace
{
  struct B1
  {
    static void fn1 () {}
    static void fn4 ();
  };
  void fn3 () {}
  void B1::fn4 () {}
  static void fn5 () {}
}

int main ()
{
  struct B2
  {
    static void fn2 () {}
  };
  call<&B1::fn1> ();
  call<&B2::fn2> ();	// { dg-error "not external linkage|no matching" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 29 }
  call<&fn3> ();
  call<&B1::fn4> ();
  call<&fn5> ();	// { dg-error "not external linkage|no matching" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 33 }
}