Richard Smith | 994d73f | 2012-04-11 20:59:20 +0000 | [diff] [blame] | 1 | // RUN: %clang -cc1 -verify -std=c++11 %s |
| 2 | |
| 3 | 8gi///===--- recovery.cpp ---===// // expected-error {{unqualified-id}} |
| 4 | namespace Std { // expected-note {{here}} |
| 5 | typedef int Important; |
| 6 | } |
| 7 | |
| 8 | / redeclare as an inline namespace // expected-error {{unqualified-id}} |
| 9 | inline namespace Std { // expected-error {{cannot be reopened as inline}} |
| 10 | Important n; |
| 11 | } / end namespace Std // expected-error {{unqualified-id}} |
| 12 | int x; |
| 13 | Std::Important y; |
| 14 | |
Kaelyn Uhrain | 50dc12a | 2012-06-15 23:45:58 +0000 | [diff] [blame^] | 15 | extenr "C" { // expected-error {{did you mean the keyword 'extern'}} |
Richard Smith | 994d73f | 2012-04-11 20:59:20 +0000 | [diff] [blame] | 16 | void f(); |
| 17 | } |
| 18 | void g() { |
| 19 | z = 1; // expected-error {{undeclared}} |
Kaelyn Uhrain | 50dc12a | 2012-06-15 23:45:58 +0000 | [diff] [blame^] | 20 | f(); |
Richard Smith | 994d73f | 2012-04-11 20:59:20 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | struct S { |
| 24 | int a, b, c; |
| 25 | S(); |
| 26 | }; |
| 27 | 8S::S() : a{ 5 }, b{ 6 }, c{ 2 } { // expected-error {{unqualified-id}} |
| 28 | return; |
| 29 | } |
| 30 | int k; |
| 31 | int l = k; |
| 32 | |
| 33 | 5int m = { l }, n = m; // expected-error {{unqualified-id}} |
| 34 | |
| 35 | namespace N { |
| 36 | int |
| 37 | } // expected-error {{unqualified-id}} |
| 38 | |
Kaelyn Uhrain | 50dc12a | 2012-06-15 23:45:58 +0000 | [diff] [blame^] | 39 | strcut Uuuu { // expected-error {{did you mean the keyword 'struct'}} \ |
| 40 | // expected-note {{'Uuuu' declared here}} |
| 41 | } *u[3]; |
| 42 | uuuu v; // expected-error {{did you mean 'Uuuu'}} |