Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | a6f0f9d | 2009-08-31 19:52:13 +0000 | [diff] [blame] | 2 | |
| 3 | class X {}; |
| 4 | |
| 5 | void test() { |
| 6 | X x; |
| 7 | |
Douglas Gregor | 2d1c214 | 2009-11-03 19:44:04 +0000 | [diff] [blame] | 8 | x.int; // expected-error{{expected unqualified-id}} |
Douglas Gregor | 124b878 | 2010-02-16 19:09:40 +0000 | [diff] [blame] | 9 | x.~int(); // expected-error{{expected a class name}} |
Douglas Gregor | a6f0f9d | 2009-08-31 19:52:13 +0000 | [diff] [blame] | 10 | x.operator; // expected-error{{missing type specifier after 'operator'}} |
| 11 | x.operator typedef; // expected-error{{missing type specifier after 'operator'}} |
| 12 | } |
| 13 | |
| 14 | void test2() { |
| 15 | X *x; |
| 16 | |
Douglas Gregor | 2d1c214 | 2009-11-03 19:44:04 +0000 | [diff] [blame] | 17 | x->int; // expected-error{{expected unqualified-id}} |
Douglas Gregor | 124b878 | 2010-02-16 19:09:40 +0000 | [diff] [blame] | 18 | x->~int(); // expected-error{{expected a class name}} |
Douglas Gregor | a6f0f9d | 2009-08-31 19:52:13 +0000 | [diff] [blame] | 19 | x->operator; // expected-error{{missing type specifier after 'operator'}} |
| 20 | x->operator typedef; // expected-error{{missing type specifier after 'operator'}} |
| 21 | } |
John McCall | 7727acf | 2010-03-31 02:13:20 +0000 | [diff] [blame] | 22 | |
| 23 | // PR6327 |
| 24 | namespace test3 { |
| 25 | template <class A, class B> struct pair {}; |
| 26 | |
| 27 | void test0() { |
| 28 | pair<int, int> z = minmax({}); // expected-error {{expected expression}} |
| 29 | } |
| 30 | |
| 31 | struct string { |
| 32 | class iterator {}; |
| 33 | }; |
| 34 | |
| 35 | void test1() { |
| 36 | string s; |
| 37 | string::iterator i = s.foo(); // expected-error {{no member named 'foo'}} |
| 38 | } |
| 39 | } |