summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/member-pointer.cpp
blob: 2568cb59d8b79495b32b59aee0ecf5b4c62665f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: clang -fsyntax-only -verify %s

struct A {};
enum B { Dummy };
namespace C {}

int A::*pdi1;
int (::A::*pdi2);
int (A::*pfi)(int);

int B::*pbi; // expected-error {{expected a class or namespace}}
int C::*pci; // expected-error {{'pci' does not point into a class}}
void A::*pdv; // expected-error {{'pdv' declared as a member pointer to void}}
int& A::*pdr; // expected-error {{'pdr' declared as a pointer to a reference}}

void f() {
  // This requires tentative parsing.
  int (A::*pf)(int, int);
}
OpenPOWER on IntegriCloud