• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 class X {};
4 
test()5 void test() {
6   X x;
7 
8   x.int; // expected-error{{expected unqualified-id}}
9   x.~int(); // expected-error{{expected a class name}}
10   x.operator; // expected-error{{expected a type}}
11   x.operator typedef; // expected-error{{expected a type}} expected-error{{type name does not allow storage class}}
12 }
13 
test2()14 void test2() {
15   X *x;
16 
17   x->int; // expected-error{{expected unqualified-id}}
18   x->~int(); // expected-error{{expected a class name}}
19   x->operator; // expected-error{{expected a type}}
20   x->operator typedef; // expected-error{{expected a type}} expected-error{{type name does not allow storage class}}
21 }
22 
23 // PR6327
24 namespace test3 {
25   template <class A, class B> struct pair {};
26 
test0()27   void test0() {
28     pair<int, int> z = minmax({}); // expected-error {{expected expression}}
29   }
30 
31   struct string {
32     class iterator {};
33   };
34 
test1()35   void test1() {
36     string s;
37     string::iterator i = s.foo(); // expected-error {{no member named 'foo'}}
38   }
39 }
40