blob: 41845fb291584c5e1dfcfc286e19d98ebe388278 [file] [log] [blame]
David Tweeda0d58782012-10-25 13:56:30 +00001// RUN: %clang_cc1 -verify -std=c++11 %s
Richard Smith994d73f2012-04-11 20:59:20 +00002
38gi///===--- recovery.cpp ---===// // expected-error {{unqualified-id}}
4namespace Std { // expected-note {{here}}
5 typedef int Important;
6}
7
8/ redeclare as an inline namespace // expected-error {{unqualified-id}}
9inline namespace Std { // expected-error {{cannot be reopened as inline}}
10 Important n;
11} / end namespace Std // expected-error {{unqualified-id}}
12int x;
13Std::Important y;
14
Kaelyn Uhrain50dc12a2012-06-15 23:45:58 +000015extenr "C" { // expected-error {{did you mean the keyword 'extern'}}
Richard Smith994d73f2012-04-11 20:59:20 +000016 void f();
17}
18void g() {
19 z = 1; // expected-error {{undeclared}}
Kaelyn Uhrain50dc12a2012-06-15 23:45:58 +000020 f();
Richard Smith994d73f2012-04-11 20:59:20 +000021}
22
23struct S {
24 int a, b, c;
25 S();
Richard Smith53aec2a2012-10-25 00:00:53 +000026 int x // expected-error {{expected ';'}}
27 friend void f()
Richard Smith994d73f2012-04-11 20:59:20 +000028};
298S::S() : a{ 5 }, b{ 6 }, c{ 2 } { // expected-error {{unqualified-id}}
30 return;
31}
32int k;
Richard Smith53aec2a2012-10-25 00:00:53 +000033int l = k // expected-error {{expected ';'}}
34constexpr int foo();
Richard Smith994d73f2012-04-11 20:59:20 +000035
365int m = { l }, n = m; // expected-error {{unqualified-id}}
37
38namespace N {
39 int
40} // expected-error {{unqualified-id}}
41
Kaelyn Uhrain50dc12a2012-06-15 23:45:58 +000042strcut Uuuu { // expected-error {{did you mean the keyword 'struct'}} \
43 // expected-note {{'Uuuu' declared here}}
44} *u[3];
45uuuu v; // expected-error {{did you mean 'Uuuu'}}
Richard Smith37ec8d52012-12-05 11:34:06 +000046
47struct Redefined { // expected-note {{previous}}
48 Redefined() {}
49};
50struct Redefined { // expected-error {{redefinition}}
51 Redefined() {}
52};