view gcc/testsuite/g++.dg/ext/visibility/anon8.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// 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 "linkage|no matching" }
  call<&fn3> ();
  call<&B1::fn4> ();
  call<&fn5> ();	// { dg-error "linkage|no matching" "" { target { ! c++11 } } }
}