blob: 38467117b340bc31a7052fe97ab55945ccedc522 [file] [log] [blame]
Chris Lattner8129edb2009-04-12 22:23:27 +00001// RUN: clang-cc -verify -fsyntax-only %s
2
3int x(*g); // expected-error {{use of undeclared identifier 'g'}}
Chris Lattner46646492009-12-07 01:36:53 +00004
Chris Lattnera69d0ed2009-12-10 02:02:58 +00005struct Type {
6 int Type;
7};
Chris Lattnera1efc8c2009-12-10 01:59:24 +00008
Chris Lattner46646492009-12-07 01:36:53 +00009
10// PR4451 - We should recover well from the typo of '::' as ':' in a2.
11namespace y {
12 struct a { };
13}
14
15y::a a1;
16y:a a2; // expected-error {{unexpected ':' in nested name specifier}}
17y::a a3 = a2;
18
19// Some valid colons:
20void foo() {
21y: // label
22 y::a s;
23
24 int a = 4;
25 a = a ? a : a+1;
26}
27
28struct b : y::a {};
29
30template <typename T>
31class someclass {
32
33 int bar() {
34 T *P;
35 return 1 ? P->x : P->y;
36 }
37};
Chris Lattnera1efc8c2009-12-10 01:59:24 +000038
39enum { fooenum = 1 };
40
41struct a {
42 int Type : fooenum;
43};
44
Chris Lattnera69d0ed2009-12-10 02:02:58 +000045void test(struct Type *P) {
46 int Type;
47 Type = 1 ? P->Type : Type;
48}