blob: 7307a47f8282c1595a303816d6f8108b44041662 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregora6f0f9d2009-08-31 19:52:13 +00002
3class X {};
4
5void test() {
6 X x;
7
Douglas Gregor2d1c2142009-11-03 19:44:04 +00008 x.int; // expected-error{{expected unqualified-id}}
Douglas Gregor124b8782010-02-16 19:09:40 +00009 x.~int(); // expected-error{{expected a class name}}
Douglas Gregora6f0f9d2009-08-31 19:52:13 +000010 x.operator; // expected-error{{missing type specifier after 'operator'}}
11 x.operator typedef; // expected-error{{missing type specifier after 'operator'}}
12}
13
14void test2() {
15 X *x;
16
Douglas Gregor2d1c2142009-11-03 19:44:04 +000017 x->int; // expected-error{{expected unqualified-id}}
Douglas Gregor124b8782010-02-16 19:09:40 +000018 x->~int(); // expected-error{{expected a class name}}
Douglas Gregora6f0f9d2009-08-31 19:52:13 +000019 x->operator; // expected-error{{missing type specifier after 'operator'}}
20 x->operator typedef; // expected-error{{missing type specifier after 'operator'}}
21}
John McCall7727acf2010-03-31 02:13:20 +000022
23// PR6327
24namespace 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}