[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / Parser / cxx-decl.cpp
blob6d720d36a259faacb7ec9619817deba1c05b786f
1 // RUN: %clang_cc1 -verify -fsyntax-only %s
3 int x(*g); // expected-error {{use of undeclared identifier 'g'}}
5 struct Type {
6 int Type;
7 };
9 // rdar://8365458
10 typedef char bool; // expected-error {{redeclaration of C++ built-in type 'bool'}} \
11 // expected-warning {{declaration does not declare anything}}
13 // PR4451 - We should recover well from the typo of '::' as ':' in a2.
14 namespace y {
15 struct a { };
16 typedef int b;
19 y::a a1;
20 y:a a2; // expected-error {{unexpected ':' in nested name specifier}}
21 y::a a3 = a2;
23 // Some valid colons:
24 void foo() {
25 y: // label
26 y::a s;
28 int a = 4;
29 a = a ? a : a+1;
32 struct b : y::a {};
34 template <typename T>
35 class someclass {
37 int bar() {
38 T *P;
39 return 1 ? P->x : P->y;
43 class asm_class_test {
44 void foo() __asm__("baz");
47 enum { fooenum = 1 };
49 struct a {
50 int Type : fooenum;
53 void test(struct Type *P) {
54 int Type;
55 Type = 1 ? P->Type : Type;
57 Type = (y:b) 4; // expected-error {{unexpected ':' in nested name specifier}}
58 Type = 1 ? (
59 (y:b) // expected-error {{unexpected ':' in nested name specifier}}
60 4) : 5;
63 struct test4 {
64 int x // expected-error {{expected ';' at end of declaration list}}
65 int y;
66 int z // expected-error {{expected ';' at end of declaration list}}
69 // PR5825
70 struct test5 {};
71 ::new(static_cast<void*>(0)) test5; // expected-error {{expected unqualified-id}}
74 // PR6782
75 template<class T>
76 class Class1;
78 class Class2 {
79 } // no ;
81 typedef Class1<Class2> Type1; // expected-error {{cannot combine with previous 'class' declaration specifier}}
83 // rdar : // 8307865
84 struct CodeCompleteConsumer {
87 void CodeCompleteConsumer::() { // expected-error {{xpected unqualified-id}}
92 // PR8380
93 extern "" // expected-error {{unknown linkage language}}
94 test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \
95 // expected-error {{expected ';' after top level declarator}}
97 int test6b;