Eli Friedman | a03c5ee | 2013-08-12 21:54:01 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify -fblocks %s |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 2 | namespace A { |
| 3 | struct C { |
| 4 | static int cx; |
Douglas Gregor | 656de63 | 2009-03-11 23:52:16 +0000 | [diff] [blame] | 5 | |
| 6 | static int cx2; |
| 7 | |
| 8 | static int Ag1(); |
| 9 | static int Ag2(); |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 10 | }; |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 11 | int ax; // expected-note {{'ax' declared here}} |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 12 | void Af(); |
| 13 | } |
| 14 | |
| 15 | A:: ; // expected-error {{expected unqualified-id}} |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 16 | ::A::ax::undef ex3; // expected-error {{'ax' is not a class, namespace, or scoped enumeration}} |
Jeffrey Yasskin | edc2877 | 2010-04-07 23:29:58 +0000 | [diff] [blame] | 17 | A::undef1::undef2 ex4; // expected-error {{no member named 'undef1'}} |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 18 | |
Douglas Gregor | 656de63 | 2009-03-11 23:52:16 +0000 | [diff] [blame] | 19 | int A::C::Ag1() { return 0; } |
| 20 | |
Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 21 | static int A::C::Ag2() { return 0; } // expected-error{{'static' can}} |
Douglas Gregor | 656de63 | 2009-03-11 23:52:16 +0000 | [diff] [blame] | 22 | |
| 23 | int A::C::cx = 17; |
| 24 | |
| 25 | |
Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 26 | static int A::C::cx2 = 17; // expected-error{{'static' can}} |
Douglas Gregor | 656de63 | 2009-03-11 23:52:16 +0000 | [diff] [blame] | 27 | |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 28 | class C2 { |
Kaelyn Uhrain | 1055393 | 2011-10-10 18:01:37 +0000 | [diff] [blame] | 29 | void m(); // expected-note{{member declaration does not match because it is not const qualified}} |
Douglas Gregor | 584049d | 2008-12-15 23:53:10 +0000 | [diff] [blame] | 30 | |
Kaelyn Uhrain | 4d9d157 | 2011-08-04 17:40:00 +0000 | [diff] [blame] | 31 | void f(const int& parm); // expected-note{{type of 1st parameter of member declaration does not match definition ('const int &' vs 'int')}} |
Kaelyn Uhrain | 1055393 | 2011-10-10 18:01:37 +0000 | [diff] [blame] | 32 | void f(int) const; // expected-note{{member declaration does not match because it is const qualified}} |
Douglas Gregor | 584049d | 2008-12-15 23:53:10 +0000 | [diff] [blame] | 33 | void f(float); |
| 34 | |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 35 | int x; |
| 36 | }; |
| 37 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 38 | void C2::m() const { } // expected-error{{out-of-line definition of 'm' does not match any declaration in 'C2'}} |
Douglas Gregor | 584049d | 2008-12-15 23:53:10 +0000 | [diff] [blame] | 39 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 40 | void C2::f(int) { } // expected-error{{out-of-line definition of 'f' does not match any declaration in 'C2'}} |
Douglas Gregor | 584049d | 2008-12-15 23:53:10 +0000 | [diff] [blame] | 41 | |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 42 | void C2::m() { |
| 43 | x = 0; |
| 44 | } |
| 45 | |
| 46 | namespace B { |
Richard Smith | a1c4f7c | 2012-04-13 04:07:40 +0000 | [diff] [blame] | 47 | void ::A::Af() {} // expected-error {{cannot define or redeclare 'Af' here because namespace 'B' does not enclose namespace 'A'}} |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | void f1() { |
Douglas Gregor | 584049d | 2008-12-15 23:53:10 +0000 | [diff] [blame] | 51 | void A::Af(); // expected-error {{definition or redeclaration of 'Af' not allowed inside a function}} |
Eli Friedman | a03c5ee | 2013-08-12 21:54:01 +0000 | [diff] [blame] | 52 | void (^x)() = ^{ void A::Af(); }; // expected-error {{definition or redeclaration of 'Af' not allowed inside a block}} |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | void f2() { |
| 56 | A:: ; // expected-error {{expected unqualified-id}} |
| 57 | A::C::undef = 0; // expected-error {{no member named 'undef'}} |
| 58 | ::A::C::cx = 0; |
| 59 | int x = ::A::ax = A::C::cx; |
| 60 | x = sizeof(A::C); |
| 61 | x = sizeof(::A::C::cx); |
| 62 | } |
| 63 | |
| 64 | A::C c1; |
| 65 | struct A::C c2; |
| 66 | struct S : public A::C {}; |
Douglas Gregor | 1eabb7d | 2010-03-31 23:17:41 +0000 | [diff] [blame] | 67 | struct A::undef; // expected-error {{no struct named 'undef' in namespace 'A'}} |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 68 | |
Argyrios Kyrtzidis | 5239304 | 2008-11-09 23:41:00 +0000 | [diff] [blame] | 69 | namespace A2 { |
| 70 | typedef int INT; |
| 71 | struct RC; |
Argyrios Kyrtzidis | 77407b8 | 2008-11-19 18:01:13 +0000 | [diff] [blame] | 72 | struct CC { |
| 73 | struct NC; |
| 74 | }; |
Argyrios Kyrtzidis | 5239304 | 2008-11-09 23:41:00 +0000 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | struct A2::RC { |
| 78 | INT x; |
| 79 | }; |
| 80 | |
Argyrios Kyrtzidis | 77407b8 | 2008-11-19 18:01:13 +0000 | [diff] [blame] | 81 | struct A2::CC::NC { |
| 82 | void m() {} |
| 83 | }; |
| 84 | |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 85 | void f3() { |
| 86 | N::x = 0; // expected-error {{use of undeclared identifier 'N'}} |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 87 | // FIXME: Consider including the kind of entity that 'N' is ("variable 'N' |
| 88 | // declared here", "template 'X' declared here", etc) to help explain what it |
| 89 | // is if it's 'not a class, namespace, or scoped enumeration'. |
| 90 | int N; // expected-note {{'N' declared here}} |
| 91 | N::x = 0; // expected-error {{'N' is not a class, namespace, or scoped enumeration}} |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 92 | { int A; A::ax = 0; } |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 93 | { typedef int A; A::ax = 0; } // expected-error{{'A' (aka 'int') is not a class, namespace, or scoped enumeration}} |
Argyrios Kyrtzidis | ef6e647 | 2008-11-08 17:17:31 +0000 | [diff] [blame] | 94 | { typedef A::C A; A::ax = 0; } // expected-error {{no member named 'ax'}} |
| 95 | { typedef A::C A; A::cx = 0; } |
| 96 | } |
Argyrios Kyrtzidis | 08b2c37 | 2008-11-19 15:22:16 +0000 | [diff] [blame] | 97 | |
| 98 | // make sure the following doesn't hit any asserts |
Richard Smith | 0576681 | 2012-08-18 00:55:03 +0000 | [diff] [blame] | 99 | void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} |
Douglas Gregor | 584049d | 2008-12-15 23:53:10 +0000 | [diff] [blame] | 100 | |
| 101 | typedef void C2::f5(int); // expected-error{{typedef declarator cannot be qualified}} |
| 102 | |
| 103 | void f6(int A2::RC::x); // expected-error{{parameter declarator cannot be qualified}} |
| 104 | |
| 105 | int A2::RC::x; // expected-error{{non-static data member defined out-of-line}} |
| 106 | |
Chandler Carruth | 34fa294 | 2010-07-16 05:46:45 +0000 | [diff] [blame] | 107 | void A2::CC::NC::m(); // expected-error{{out-of-line declaration of a member must be a definition}} |
Douglas Gregor | 3dde5a3 | 2008-12-16 06:37:47 +0000 | [diff] [blame] | 108 | |
| 109 | |
| 110 | namespace E { |
| 111 | int X = 5; |
| 112 | |
| 113 | namespace Nested { |
| 114 | enum E { |
| 115 | X = 0 |
| 116 | }; |
| 117 | |
Kaelyn Uhrain | ef094a1 | 2012-06-07 23:57:08 +0000 | [diff] [blame] | 118 | void f() { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 119 | return E::X; // expected-error{{'E::Nested::E' is not a class, namespace, or scoped enumeration}} |
Douglas Gregor | 3dde5a3 | 2008-12-16 06:37:47 +0000 | [diff] [blame] | 120 | } |
| 121 | } |
| 122 | } |
Douglas Gregor | 70316a0 | 2008-12-26 15:00:45 +0000 | [diff] [blame] | 123 | |
| 124 | |
| 125 | class Operators { |
Kaelyn Uhrain | 1055393 | 2011-10-10 18:01:37 +0000 | [diff] [blame] | 126 | Operators operator+(const Operators&) const; // expected-note{{member declaration does not match because it is const qualified}} |
Douglas Gregor | 70316a0 | 2008-12-26 15:00:45 +0000 | [diff] [blame] | 127 | operator bool(); |
| 128 | }; |
| 129 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 130 | Operators Operators::operator+(const Operators&) { // expected-error{{out-of-line definition of 'operator+' does not match any declaration in 'Operators'}} |
Douglas Gregor | 70316a0 | 2008-12-26 15:00:45 +0000 | [diff] [blame] | 131 | Operators ops; |
| 132 | return ops; |
| 133 | } |
| 134 | |
| 135 | Operators Operators::operator+(const Operators&) const { |
| 136 | Operators ops; |
| 137 | return ops; |
| 138 | } |
| 139 | |
| 140 | Operators::operator bool() { |
| 141 | return true; |
| 142 | } |
Douglas Gregor | 4ce205f | 2009-02-06 17:46:57 +0000 | [diff] [blame] | 143 | |
| 144 | namespace A { |
Kaelyn Uhrain | 4d9d157 | 2011-08-04 17:40:00 +0000 | [diff] [blame] | 145 | void g(int&); // expected-note{{type of 1st parameter of member declaration does not match definition ('int &' vs 'const int &')}} |
Douglas Gregor | 4ce205f | 2009-02-06 17:46:57 +0000 | [diff] [blame] | 146 | } |
| 147 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 148 | void A::f() {} // expected-error-re{{out-of-line definition of 'f' does not match any declaration in namespace 'A'{{$}}}} |
Douglas Gregor | 4ce205f | 2009-02-06 17:46:57 +0000 | [diff] [blame] | 149 | |
Douglas Gregor | 3f09327 | 2009-10-13 21:16:44 +0000 | [diff] [blame] | 150 | void A::g(const int&) { } // expected-error{{out-of-line definition of 'g' does not match any declaration in namespace 'A'}} |
Douglas Gregor | 4ce205f | 2009-02-06 17:46:57 +0000 | [diff] [blame] | 151 | |
| 152 | struct Struct { }; |
| 153 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 154 | void Struct::f() { } // expected-error{{out-of-line definition of 'f' does not match any declaration in 'Struct'}} |
Douglas Gregor | 4ce205f | 2009-02-06 17:46:57 +0000 | [diff] [blame] | 155 | |
| 156 | void global_func(int); |
| 157 | void global_func2(int); |
| 158 | |
| 159 | namespace N { |
| 160 | void ::global_func(int) { } // expected-error{{definition or redeclaration of 'global_func' cannot name the global scope}} |
| 161 | |
| 162 | void f(); |
| 163 | // FIXME: if we move this to a separate definition of N, things break! |
| 164 | } |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 165 | void ::global_func2(int) { } // expected-warning{{extra qualification on member 'global_func2'}} |
Douglas Gregor | 4ce205f | 2009-02-06 17:46:57 +0000 | [diff] [blame] | 166 | |
| 167 | void N::f() { } // okay |
Douglas Gregor | 9fa14a5 | 2009-03-06 19:06:37 +0000 | [diff] [blame] | 168 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 169 | struct Y; // expected-note{{forward declaration of 'Y'}} |
Jeffrey Yasskin | 9ab1454 | 2010-04-08 16:38:48 +0000 | [diff] [blame] | 170 | Y::foo y; // expected-error{{incomplete type 'Y' named in nested name specifier}} |
Douglas Gregor | 4fdf1fa | 2009-03-11 16:48:53 +0000 | [diff] [blame] | 171 | |
Richard Smith | b79b17b | 2013-10-15 00:00:26 +0000 | [diff] [blame] | 172 | X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}} |
Chris Lattner | c8e27cc | 2009-06-26 04:27:47 +0000 | [diff] [blame] | 173 | |
Argyrios Kyrtzidis | f37006b | 2009-07-21 06:43:26 +0000 | [diff] [blame] | 174 | struct foo_S { |
| 175 | static bool value; |
| 176 | }; |
| 177 | bool (foo_S::value); |
Chris Lattner | c8e27cc | 2009-06-26 04:27:47 +0000 | [diff] [blame] | 178 | |
| 179 | |
| 180 | namespace somens { |
John McCall | 220ccbf | 2010-01-13 00:25:19 +0000 | [diff] [blame] | 181 | struct a { }; // expected-note{{candidate constructor (the implicit copy constructor)}} |
Chris Lattner | c8e27cc | 2009-06-26 04:27:47 +0000 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | template <typename T> |
| 185 | class foo { |
| 186 | }; |
| 187 | |
| 188 | |
Chris Lattner | 4664649 | 2009-12-07 01:36:53 +0000 | [diff] [blame] | 189 | // PR4452 / PR4451 |
| 190 | foo<somens:a> a2; // expected-error {{unexpected ':' in nested name specifier}} |
Chris Lattner | c8e27cc | 2009-06-26 04:27:47 +0000 | [diff] [blame] | 191 | |
Douglas Gregor | 7abfbdb | 2009-12-19 03:01:41 +0000 | [diff] [blame] | 192 | somens::a a3 = a2; // expected-error {{no viable conversion}} |
Chris Lattner | c8e27cc | 2009-06-26 04:27:47 +0000 | [diff] [blame] | 193 | |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame] | 194 | // typedefs and using declarations. |
| 195 | namespace test1 { |
| 196 | namespace ns { |
John McCall | 7002f4c | 2010-04-09 19:03:51 +0000 | [diff] [blame] | 197 | class Counter { public: static int count; }; |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame] | 198 | typedef Counter counter; |
| 199 | } |
| 200 | using ns::counter; |
Chris Lattner | c8e27cc | 2009-06-26 04:27:47 +0000 | [diff] [blame] | 201 | |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame] | 202 | class Test { |
| 203 | void test1() { |
| 204 | counter c; |
| 205 | c.count++; |
| 206 | counter::count++; |
| 207 | } |
| 208 | }; |
| 209 | } |
John McCall | 731ad84 | 2009-12-19 09:28:58 +0000 | [diff] [blame] | 210 | |
| 211 | // We still need to do lookup in the lexical scope, even if we push a |
| 212 | // non-lexical scope. |
| 213 | namespace test2 { |
| 214 | namespace ns { |
Sebastian Redl | 78a527a | 2010-01-26 18:52:33 +0000 | [diff] [blame] | 215 | extern int *count_ptr; |
John McCall | 731ad84 | 2009-12-19 09:28:58 +0000 | [diff] [blame] | 216 | } |
| 217 | namespace { |
| 218 | int count = 0; |
| 219 | } |
| 220 | |
| 221 | int *ns::count_ptr = &count; |
| 222 | } |
John McCall | 4c72d3e | 2010-02-08 19:26:07 +0000 | [diff] [blame] | 223 | |
| 224 | // PR6259, invalid case |
| 225 | namespace test3 { |
Jeffrey Yasskin | 9ab1454 | 2010-04-08 16:38:48 +0000 | [diff] [blame] | 226 | class A; // expected-note {{forward declaration}} |
John McCall | 4c72d3e | 2010-02-08 19:26:07 +0000 | [diff] [blame] | 227 | void foo(const char *path) { |
Jeffrey Yasskin | 9ab1454 | 2010-04-08 16:38:48 +0000 | [diff] [blame] | 228 | A::execute(path); // expected-error {{incomplete type 'test3::A' named in nested name specifier}} |
John McCall | 4c72d3e | 2010-02-08 19:26:07 +0000 | [diff] [blame] | 229 | } |
| 230 | } |
Douglas Gregor | 00b4b03 | 2010-05-14 04:53:42 +0000 | [diff] [blame] | 231 | |
| 232 | namespace PR7133 { |
| 233 | namespace A { |
| 234 | class Foo; |
| 235 | } |
| 236 | |
| 237 | namespace A { |
| 238 | namespace B { |
| 239 | bool foo(Foo &); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | bool A::B::foo(Foo &) { |
| 244 | return false; |
| 245 | } |
| 246 | } |
Francois Pichet | c71d8eb | 2010-10-01 21:19:28 +0000 | [diff] [blame] | 247 | |
| 248 | class CLASS { |
Douglas Gregor | 7537945 | 2012-09-13 20:16:20 +0000 | [diff] [blame] | 249 | void CLASS::foo2(); // expected-error {{extra qualification on member 'foo2'}} |
Francois Pichet | c71d8eb | 2010-10-01 21:19:28 +0000 | [diff] [blame] | 250 | }; |
Douglas Gregor | 922fff2 | 2010-10-13 22:19:53 +0000 | [diff] [blame] | 251 | |
| 252 | namespace PR8159 { |
| 253 | class B { }; |
| 254 | |
| 255 | class A { |
Douglas Gregor | 7537945 | 2012-09-13 20:16:20 +0000 | [diff] [blame] | 256 | int A::a; // expected-error{{extra qualification on member 'a'}} |
| 257 | static int A::b; // expected-error{{extra qualification on member 'b'}} |
Douglas Gregor | 922fff2 | 2010-10-13 22:19:53 +0000 | [diff] [blame] | 258 | int ::c; // expected-error{{non-friend class member 'c' cannot have a qualified name}} |
| 259 | }; |
| 260 | } |
Argyrios Kyrtzidis | 1de34dd | 2011-02-05 05:54:49 +0000 | [diff] [blame] | 261 | |
| 262 | namespace rdar7980179 { |
| 263 | class A { void f0(); }; // expected-note {{previous}} |
Richard Smith | 8ef1b37 | 2013-08-23 02:16:48 +0000 | [diff] [blame] | 264 | int A::f0() {} // expected-error {{return type of out-of-line definition of 'rdar7980179::A::f0' differs}} |
Argyrios Kyrtzidis | 1de34dd | 2011-02-05 05:54:49 +0000 | [diff] [blame] | 265 | } |
Douglas Gregor | fa0b48f | 2011-02-24 02:37:39 +0000 | [diff] [blame] | 266 | |
| 267 | namespace alias = A; |
| 268 | double *dp = (alias::C*)0; // expected-error{{cannot initialize a variable of type 'double *' with an rvalue of type 'alias::C *'}} |
Argyrios Kyrtzidis | a7bf7bb | 2011-06-24 19:59:27 +0000 | [diff] [blame] | 269 | |
| 270 | // http://llvm.org/PR10109 |
| 271 | namespace PR10109 { |
| 272 | template<typename T> |
| 273 | struct A { |
| 274 | protected: |
| 275 | struct B; |
| 276 | struct B::C; // expected-error {{requires a template parameter list}} \ |
Douglas Gregor | 42acead | 2012-03-17 23:06:31 +0000 | [diff] [blame] | 277 | // expected-error {{no struct named 'C'}} \ |
| 278 | // expected-error{{non-friend class member 'C' cannot have a qualified name}} |
Argyrios Kyrtzidis | a7bf7bb | 2011-06-24 19:59:27 +0000 | [diff] [blame] | 279 | }; |
| 280 | |
| 281 | template<typename T> |
| 282 | struct A2 { |
| 283 | protected: |
| 284 | struct B; |
| 285 | }; |
| 286 | template <typename T> |
| 287 | struct A2<T>::B::C; // expected-error {{no struct named 'C'}} |
| 288 | } |
Kaelyn Uhrain | 8d3607b | 2012-06-06 20:54:51 +0000 | [diff] [blame] | 289 | |
| 290 | namespace PR13033 { |
| 291 | namespace NS { |
| 292 | int a; // expected-note {{'NS::a' declared here}} |
| 293 | int longer_b; //expected-note {{'NS::longer_b' declared here}} |
| 294 | } |
| 295 | |
| 296 | // Suggest adding a namespace qualifier to both variable names even though one |
| 297 | // is only a single character long. |
| 298 | int foobar = a + longer_b; // expected-error {{use of undeclared identifier 'a'; did you mean 'NS::a'?}} \ |
| 299 | // expected-error {{use of undeclared identifier 'longer_b'; did you mean 'NS::longer_b'?}} |
| 300 | } |
Douglas Gregor | 86a8730 | 2013-05-14 23:22:32 +0000 | [diff] [blame] | 301 | |
| 302 | // <rdar://problem/13853540> |
| 303 | namespace N { |
| 304 | struct X { }; |
| 305 | namespace N { |
| 306 | struct Foo { |
| 307 | struct N::X *foo(); // expected-error{{no struct named 'X' in namespace 'N::N'}} |
| 308 | }; |
| 309 | } |
| 310 | } |
Eli Friedman | c02bea4 | 2013-06-19 22:58:30 +0000 | [diff] [blame] | 311 | |
| 312 | namespace TypedefNamespace { typedef int F; }; |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 313 | TypedefNamespace::F::NonexistentName BadNNSWithCXXScopeSpec; // expected-error {{'F' (aka 'int') is not a class, namespace, or scoped enumeration}} |