summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/ptrmem8.C
blob: d0b0ba7228ea42575a265ddd622dfeb4bb324854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/33844
// { dg-do compile }

struct A {};

template<int> void foo(void (A::* f)())
{
  A a;
  &(a.*f);	// { dg-error "invalid use of\[^\n\]*\\.\\*\[^\n\]*to form|qualified-id is required" }
}

template<int> void bar(void (A::* f)())
{
  A *p;
  &(p->*f);	// { dg-error "invalid use of\[^\n\]*->\\*\[^\n\]*to form|qualified-id is required" }
}