blob: ff687583c253e3d6a82f161b8641bc88791424dc [file] [log] [blame]
Richard Smith994d73f2012-04-11 20:59:20 +00001// RUN: %clang -cc1 -verify -std=c++11 %s
2
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();
26};
278S::S() : a{ 5 }, b{ 6 }, c{ 2 } { // expected-error {{unqualified-id}}
28 return;
29}
30int k;
31int l = k;
32
335int m = { l }, n = m; // expected-error {{unqualified-id}}
34
35namespace N {
36 int
37} // expected-error {{unqualified-id}}
38
Kaelyn Uhrain50dc12a2012-06-15 23:45:58 +000039strcut Uuuu { // expected-error {{did you mean the keyword 'struct'}} \
40 // expected-note {{'Uuuu' declared here}}
41} *u[3];
42uuuu v; // expected-error {{did you mean 'Uuuu'}}