Sebastian Redl | f30208a | 2009-01-24 21:16:55 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | struct A {}; |
| 4 | enum B { Dummy }; |
| 5 | namespace C {} |
| 6 | |
| 7 | int A::*pdi1; |
| 8 | int (::A::*pdi2); |
| 9 | int (A::*pfi)(int); |
| 10 | |
| 11 | int B::*pbi; // expected-error {{expected a class or namespace}} |
| 12 | int C::*pci; // expected-error {{'pci' does not point into a class}} |
| 13 | void A::*pdv; // expected-error {{'pdv' declared as a member pointer to void}} |
| 14 | int& A::*pdr; // expected-error {{'pdr' declared as a pointer to a reference}} |
Sebastian Redl | 8edef7c | 2009-01-24 23:29:36 +0000 | [diff] [blame^] | 15 | |
| 16 | void f() { |
| 17 | // This requires tentative parsing. |
| 18 | int (A::*pf)(int, int); |
| 19 | } |