David Majnemer | 475f9ea | 2015-10-08 08:28:09 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wbind-to-temporary-copy -verify %s |
Charles Li | 1a88adb | 2016-04-14 23:47:07 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wbind-to-temporary-copy -verify -std=c++98 %s |
| 3 | // RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wbind-to-temporary-copy -verify -std=c++11 %s |
| 4 | |
Douglas Gregor | dbc5daf | 2008-11-07 20:08:42 +0000 | [diff] [blame] | 5 | class X { |
| 6 | public: |
| 7 | operator bool(); |
| 8 | operator int() const; |
Douglas Gregor | ae2fbad | 2008-11-17 20:34:05 +0000 | [diff] [blame] | 9 | |
| 10 | bool f() { |
| 11 | return operator bool(); |
| 12 | } |
| 13 | |
| 14 | float g() { |
John McCall | d681c39 | 2009-12-16 08:11:27 +0000 | [diff] [blame] | 15 | return operator float(); // expected-error{{use of undeclared 'operator float'}} |
Douglas Gregor | ae2fbad | 2008-11-17 20:34:05 +0000 | [diff] [blame] | 16 | } |
Eli Friedman | 600bc24 | 2013-06-20 20:58:02 +0000 | [diff] [blame] | 17 | |
| 18 | static operator short(); // expected-error{{conversion function must be a non-static member function}} |
Douglas Gregor | dbc5daf | 2008-11-07 20:08:42 +0000 | [diff] [blame] | 19 | }; |
| 20 | |
| 21 | operator int(); // expected-error{{conversion function must be a non-static member function}} |
| 22 | |
Douglas Gregor | 92751d4 | 2008-11-17 22:58:34 +0000 | [diff] [blame] | 23 | operator int; // expected-error{{'operator int' cannot be the name of a variable or data member}} |
| 24 | |
Douglas Gregor | dbc5daf | 2008-11-07 20:08:42 +0000 | [diff] [blame] | 25 | typedef int func_type(int); |
| 26 | typedef int array_type[10]; |
| 27 | |
| 28 | class Y { |
| 29 | public: |
| 30 | void operator bool(int, ...) const; // expected-error{{conversion function cannot have a return type}} \ |
Chris Lattner | b41df4f | 2009-04-25 08:35:12 +0000 | [diff] [blame] | 31 | // expected-error{{conversion function cannot have any parameters}} |
Nico Weber | cf596d8 | 2014-05-10 19:15:24 +0000 | [diff] [blame] | 32 | |
Nico Weber | 7aeab60 | 2014-05-11 00:28:16 +0000 | [diff] [blame] | 33 | operator bool(int a = 4, int b = 6) const; // expected-error{{conversion function cannot have any parameters}} |
Nico Weber | cf596d8 | 2014-05-10 19:15:24 +0000 | [diff] [blame] | 34 | |
Chris Lattner | b41df4f | 2009-04-25 08:35:12 +0000 | [diff] [blame] | 35 | |
| 36 | operator float(...) const; // expected-error{{conversion function cannot be variadic}} |
| 37 | |
| 38 | |
Douglas Gregor | dbc5daf | 2008-11-07 20:08:42 +0000 | [diff] [blame] | 39 | operator func_type(); // expected-error{{conversion function cannot convert to a function type}} |
| 40 | operator array_type(); // expected-error{{conversion function cannot convert to an array type}} |
| 41 | }; |
| 42 | |
| 43 | |
| 44 | typedef int INT; |
| 45 | typedef INT* INT_PTR; |
| 46 | |
| 47 | class Z { |
Chris Lattner | 0369c57 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 48 | operator int(); // expected-note {{previous declaration is here}} |
| 49 | operator int**(); // expected-note {{previous declaration is here}} |
Douglas Gregor | dbc5daf | 2008-11-07 20:08:42 +0000 | [diff] [blame] | 50 | |
| 51 | operator INT(); // expected-error{{conversion function cannot be redeclared}} |
| 52 | operator INT_PTR*(); // expected-error{{conversion function cannot be redeclared}} |
| 53 | }; |
| 54 | |
| 55 | |
| 56 | class A { }; |
| 57 | |
| 58 | class B : public A { |
| 59 | public: |
John McCall | 85f9055 | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 60 | operator A&() const; // expected-warning{{conversion function converting 'B' to its base class 'A' will never be used}} |
Chris Lattner | 53fa049 | 2010-09-05 00:04:01 +0000 | [diff] [blame] | 61 | operator const void() const; // expected-warning{{conversion function converting 'B' to 'const void' will never be used}} |
John McCall | 85f9055 | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 62 | operator const B(); // expected-warning{{conversion function converting 'B' to itself will never be used}} |
Douglas Gregor | dbc5daf | 2008-11-07 20:08:42 +0000 | [diff] [blame] | 63 | }; |
Sebastian Redl | 1a99f44 | 2009-04-16 17:51:27 +0000 | [diff] [blame] | 64 | |
| 65 | // This used to crash Clang. |
| 66 | struct Flip; |
Douglas Gregor | c779e99 | 2010-04-24 20:54:38 +0000 | [diff] [blame] | 67 | struct Flop { |
Sebastian Redl | 1a99f44 | 2009-04-16 17:51:27 +0000 | [diff] [blame] | 68 | Flop(); |
John McCall | fd0b2f8 | 2010-01-06 09:43:14 +0000 | [diff] [blame] | 69 | Flop(const Flip&); // expected-note{{candidate constructor}} |
Sebastian Redl | 1a99f44 | 2009-04-16 17:51:27 +0000 | [diff] [blame] | 70 | }; |
| 71 | struct Flip { |
Douglas Gregor | a4b592a | 2009-12-19 03:01:41 +0000 | [diff] [blame] | 72 | operator Flop() const; // expected-note{{candidate function}} |
Sebastian Redl | 1a99f44 | 2009-04-16 17:51:27 +0000 | [diff] [blame] | 73 | }; |
John McCall | 85f9055 | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 74 | Flop flop = Flip(); // expected-error {{conversion from 'Flip' to 'Flop' is ambiguous}} |
Anders Carlsson | 1b12ed4 | 2009-09-13 21:33:06 +0000 | [diff] [blame] | 75 | |
| 76 | // This tests that we don't add the second conversion declaration to the list of user conversions |
| 77 | struct C { |
| 78 | operator const char *() const; |
| 79 | }; |
| 80 | |
| 81 | C::operator const char*() const { return 0; } |
| 82 | |
| 83 | void f(const C& c) { |
| 84 | const char* v = c; |
| 85 | } |
Fariborz Jahanian | f4061e3 | 2009-09-14 20:41:01 +0000 | [diff] [blame] | 86 | |
| 87 | // Test. Conversion in base class is visible in derived class. |
| 88 | class XB { |
| 89 | public: |
Fariborz Jahanian | 19c7328 | 2009-09-15 00:10:11 +0000 | [diff] [blame] | 90 | operator int(); // expected-note {{candidate function}} |
Fariborz Jahanian | f4061e3 | 2009-09-14 20:41:01 +0000 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | class Yb : public XB { |
| 94 | public: |
Fariborz Jahanian | 19c7328 | 2009-09-15 00:10:11 +0000 | [diff] [blame] | 95 | operator char(); // expected-note {{candidate function}} |
Fariborz Jahanian | f4061e3 | 2009-09-14 20:41:01 +0000 | [diff] [blame] | 96 | }; |
| 97 | |
| 98 | void f(Yb& a) { |
John McCall | 85f9055 | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 99 | if (a) { } // expected-error {{conversion from 'Yb' to 'bool' is ambiguous}} |
Fariborz Jahanian | f4061e3 | 2009-09-14 20:41:01 +0000 | [diff] [blame] | 100 | int i = a; // OK. calls XB::operator int(); |
| 101 | char ch = a; // OK. calls Yb::operator char(); |
| 102 | } |
| 103 | |
Douglas Gregor | 379d84b | 2009-11-13 18:44:21 +0000 | [diff] [blame] | 104 | // Test conversion + copy construction. |
| 105 | class AutoPtrRef { }; |
| 106 | |
| 107 | class AutoPtr { |
John McCall | 7b5f0fe | 2010-07-22 22:44:38 +0000 | [diff] [blame] | 108 | AutoPtr(AutoPtr &); // expected-note{{declared private here}} |
Douglas Gregor | 379d84b | 2009-11-13 18:44:21 +0000 | [diff] [blame] | 109 | |
| 110 | public: |
| 111 | AutoPtr(); |
| 112 | AutoPtr(AutoPtrRef); |
| 113 | |
| 114 | operator AutoPtrRef(); |
| 115 | }; |
| 116 | |
| 117 | AutoPtr make_auto_ptr(); |
| 118 | |
| 119 | AutoPtr test_auto_ptr(bool Cond) { |
| 120 | AutoPtr p1( make_auto_ptr() ); |
| 121 | |
| 122 | AutoPtr p; |
| 123 | if (Cond) |
John McCall | 7b5f0fe | 2010-07-22 22:44:38 +0000 | [diff] [blame] | 124 | return p; // expected-error{{calling a private constructor}} |
Douglas Gregor | 379d84b | 2009-11-13 18:44:21 +0000 | [diff] [blame] | 125 | |
| 126 | return AutoPtr(); |
| 127 | } |
| 128 | |
Douglas Gregor | e1314a6 | 2009-12-18 05:02:21 +0000 | [diff] [blame] | 129 | struct A1 { |
| 130 | A1(const char *); |
| 131 | ~A1(); |
Douglas Gregor | 379d84b | 2009-11-13 18:44:21 +0000 | [diff] [blame] | 132 | |
Douglas Gregor | e1314a6 | 2009-12-18 05:02:21 +0000 | [diff] [blame] | 133 | private: |
John McCall | 7b5f0fe | 2010-07-22 22:44:38 +0000 | [diff] [blame] | 134 | A1(const A1&); // expected-note 2 {{declared private here}} |
Douglas Gregor | e1314a6 | 2009-12-18 05:02:21 +0000 | [diff] [blame] | 135 | }; |
| 136 | |
| 137 | A1 f() { |
John McCall | 7b5f0fe | 2010-07-22 22:44:38 +0000 | [diff] [blame] | 138 | // FIXME: redundant diagnostics! |
Charles Li | 1a88adb | 2016-04-14 23:47:07 +0000 | [diff] [blame] | 139 | return "Hello"; // expected-error {{calling a private constructor}} |
| 140 | #if __cplusplus <= 199711L |
| 141 | // expected-warning@-2 {{an accessible copy constructor}} |
| 142 | #else |
| 143 | // expected-warning@-4 {{copying parameter of type 'A1' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}} |
| 144 | #endif |
Douglas Gregor | e1314a6 | 2009-12-18 05:02:21 +0000 | [diff] [blame] | 145 | } |
Douglas Gregor | 5c0066f | 2010-04-12 23:19:01 +0000 | [diff] [blame] | 146 | |
| 147 | namespace source_locations { |
| 148 | template<typename T> |
| 149 | struct sneaky_int { |
| 150 | typedef int type; |
| 151 | }; |
| 152 | |
| 153 | template<typename T, typename U> |
| 154 | struct A { }; |
| 155 | |
| 156 | template<typename T> |
| 157 | struct A<T, T> : A<T, int> { }; |
| 158 | |
| 159 | struct E { |
| 160 | template<typename T> |
| 161 | operator A<T, typename sneaky_int<T>::type>&() const; // expected-note{{candidate function}} |
| 162 | }; |
| 163 | |
| 164 | void f() { |
| 165 | A<float, float> &af = E(); // expected-error{{no viable conversion}} |
| 166 | A<float, int> &af2 = E(); |
| 167 | const A<float, int> &caf2 = E(); |
| 168 | } |
| 169 | |
| 170 | // Check |
| 171 | template<typename T> |
| 172 | struct E2 { |
| 173 | operator T |
| 174 | * // expected-error{{pointer to a reference}} |
| 175 | () const; |
| 176 | }; |
| 177 | |
| 178 | E2<int&> e2i; // expected-note{{in instantiation}} |
| 179 | } |
John McCall | 212fa2e | 2010-04-13 00:04:31 +0000 | [diff] [blame] | 180 | |
| 181 | namespace crazy_declarators { |
| 182 | struct A { |
Richard Smith | a865a16 | 2014-12-19 02:07:47 +0000 | [diff] [blame] | 183 | (&operator bool())(); // expected-error {{use a typedef to declare a conversion to 'bool (&)()'}} |
| 184 | *operator int(); // expected-error {{put the complete type after 'operator'}} |
| 185 | // No suggestion of using a typedef here; that's not possible. |
Charles Li | 1a88adb | 2016-04-14 23:47:07 +0000 | [diff] [blame] | 186 | template<typename T> (&operator T())(); |
| 187 | #if __cplusplus <= 199711L |
| 188 | // expected-error-re@-2 {{cannot specify any part of a return type in the declaration of a conversion function{{$}}}} |
| 189 | #else |
| 190 | // expected-error-re@-4 {{cannot specify any part of a return type in the declaration of a conversion function; use an alias template to declare a conversion to 'T (&)()'{{$}}}} |
| 191 | #endif |
| 192 | |
John McCall | 212fa2e | 2010-04-13 00:04:31 +0000 | [diff] [blame] | 193 | }; |
| 194 | } |
Douglas Gregor | 5ab1165 | 2010-04-17 22:01:05 +0000 | [diff] [blame] | 195 | |
| 196 | namespace smart_ptr { |
| 197 | class Y { |
| 198 | class YRef { }; |
| 199 | |
| 200 | Y(Y&); |
| 201 | |
| 202 | public: |
| 203 | Y(); |
| 204 | Y(YRef); |
| 205 | |
| 206 | operator YRef(); // expected-note{{candidate function}} |
| 207 | }; |
| 208 | |
| 209 | struct X { // expected-note{{candidate constructor (the implicit copy constructor) not}} |
Charles Li | 1a88adb | 2016-04-14 23:47:07 +0000 | [diff] [blame] | 210 | #if __cplusplus >= 201103L |
| 211 | // expected-note@-2 {{candidate constructor (the implicit move constructor) not}} |
| 212 | #endif |
| 213 | |
Douglas Gregor | 5ab1165 | 2010-04-17 22:01:05 +0000 | [diff] [blame] | 214 | explicit X(Y); |
| 215 | }; |
| 216 | |
| 217 | Y make_Y(); |
| 218 | |
| 219 | X f() { |
| 220 | X x = make_Y(); // expected-error{{no viable conversion from 'smart_ptr::Y' to 'smart_ptr::X'}} |
| 221 | X x2(make_Y()); |
| 222 | return X(Y()); |
| 223 | } |
| 224 | } |
Douglas Gregor | c779e99 | 2010-04-24 20:54:38 +0000 | [diff] [blame] | 225 | |
| 226 | struct Any { |
| 227 | Any(...); |
| 228 | }; |
| 229 | |
| 230 | struct Other { |
| 231 | Other(const Other &); |
| 232 | Other(); |
| 233 | }; |
| 234 | |
| 235 | void test_any() { |
Charles Li | 1a88adb | 2016-04-14 23:47:07 +0000 | [diff] [blame] | 236 | Any any = Other(); |
| 237 | #if __cplusplus <= 199711L |
| 238 | // expected-error@-2 {{cannot pass object of non-POD type 'Other' through variadic constructor; call will abort at runtime}} |
| 239 | #else |
| 240 | // expected-error@-4 {{cannot pass object of non-trivial type 'Other' through variadic constructor; call will abort at runtime}} |
| 241 | #endif |
Douglas Gregor | c779e99 | 2010-04-24 20:54:38 +0000 | [diff] [blame] | 242 | } |
Douglas Gregor | 836a7e8 | 2010-08-11 02:15:33 +0000 | [diff] [blame] | 243 | |
| 244 | namespace PR7055 { |
| 245 | // Make sure that we don't allow too many conversions in an |
| 246 | // auto_ptr-like template. In particular, we can't create multiple |
| 247 | // temporary objects when binding to a reference. |
| 248 | struct auto_ptr { |
| 249 | struct auto_ptr_ref { }; |
| 250 | |
| 251 | auto_ptr(auto_ptr&); |
| 252 | auto_ptr(auto_ptr_ref); |
| 253 | explicit auto_ptr(int *); |
| 254 | |
| 255 | operator auto_ptr_ref(); |
| 256 | }; |
| 257 | |
| 258 | struct X { |
| 259 | X(auto_ptr); |
| 260 | }; |
| 261 | |
| 262 | X f() { |
| 263 | X x(auto_ptr(new int)); |
| 264 | return X(auto_ptr(new int)); |
| 265 | } |
| 266 | |
| 267 | auto_ptr foo(); |
| 268 | |
| 269 | X e(foo()); |
| 270 | |
| 271 | struct Y { |
| 272 | Y(X); |
| 273 | }; |
| 274 | |
| 275 | Y f2(foo()); |
| 276 | } |
Douglas Gregor | fb64086 | 2010-08-18 21:25:30 +0000 | [diff] [blame] | 277 | |
| 278 | namespace PR7934 { |
| 279 | typedef unsigned char uint8; |
| 280 | |
| 281 | struct MutablePtr { |
| 282 | MutablePtr() : ptr(0) {} |
| 283 | void *ptr; |
| 284 | |
| 285 | operator void*() { return ptr; } |
| 286 | |
| 287 | private: |
| 288 | operator uint8*() { return reinterpret_cast<uint8*>(ptr); } |
| 289 | operator const char*() const { return reinterpret_cast<const char*>(ptr); } |
| 290 | }; |
| 291 | |
| 292 | void fake_memcpy(const void *); |
| 293 | |
| 294 | void use() { |
| 295 | MutablePtr ptr; |
| 296 | fake_memcpy(ptr); |
| 297 | } |
| 298 | } |
Douglas Gregor | c9ed468 | 2010-08-19 15:57:50 +0000 | [diff] [blame] | 299 | |
| 300 | namespace rdar8018274 { |
| 301 | struct X { }; |
| 302 | struct Y { |
| 303 | operator const struct X *() const; |
| 304 | }; |
| 305 | |
| 306 | struct Z : Y { |
| 307 | operator struct X * (); |
| 308 | }; |
| 309 | |
| 310 | void test() { |
| 311 | Z x; |
| 312 | (void) (x != __null); |
| 313 | } |
| 314 | |
| 315 | |
| 316 | struct Base { |
| 317 | operator int(); |
| 318 | }; |
| 319 | |
| 320 | struct Derived1 : Base { }; |
| 321 | |
| 322 | struct Derived2 : Base { }; |
| 323 | |
| 324 | struct SuperDerived : Derived1, Derived2 { |
| 325 | using Derived1::operator int; |
| 326 | }; |
| 327 | |
| 328 | struct UeberDerived : SuperDerived { |
| 329 | operator long(); |
| 330 | }; |
| 331 | |
| 332 | void test2(UeberDerived ud) { |
| 333 | int i = ud; // expected-error{{ambiguous conversion from derived class 'rdar8018274::SuperDerived' to base class 'rdar8018274::Base'}} |
| 334 | } |
Douglas Gregor | c0afc67 | 2010-08-19 17:02:01 +0000 | [diff] [blame] | 335 | |
| 336 | struct Base2 { |
| 337 | operator int(); |
| 338 | }; |
| 339 | |
| 340 | struct Base3 { |
| 341 | operator int(); |
| 342 | }; |
| 343 | |
| 344 | struct Derived23 : Base2, Base3 { |
| 345 | using Base2::operator int; |
| 346 | }; |
| 347 | |
| 348 | struct ExtraDerived23 : Derived23 { }; |
| 349 | |
| 350 | void test3(ExtraDerived23 ed) { |
| 351 | int i = ed; |
| 352 | } |
Douglas Gregor | c9ed468 | 2010-08-19 15:57:50 +0000 | [diff] [blame] | 353 | } |
Douglas Gregor | 6309e3d | 2010-09-12 07:22:28 +0000 | [diff] [blame] | 354 | |
| 355 | namespace PR8065 { |
| 356 | template <typename T> struct Iterator; |
| 357 | template <typename T> struct Container; |
| 358 | |
| 359 | template<> |
| 360 | struct Iterator<int> { |
| 361 | typedef Container<int> container_type; |
| 362 | }; |
| 363 | |
| 364 | template <typename T> |
| 365 | struct Container { |
| 366 | typedef typename Iterator<T>::container_type X; |
| 367 | operator X(void) { return X(); } |
| 368 | }; |
| 369 | |
| 370 | Container<int> test; |
| 371 | } |
Douglas Gregor | d5b730c9 | 2010-09-12 08:07:23 +0000 | [diff] [blame] | 372 | |
| 373 | namespace PR8034 { |
| 374 | struct C { |
| 375 | operator int(); |
| 376 | |
| 377 | private: |
| 378 | template <typename T> operator T(); |
| 379 | }; |
| 380 | int x = C().operator int(); |
| 381 | } |
Douglas Gregor | d99609a | 2011-03-06 09:03:20 +0000 | [diff] [blame] | 382 | |
| 383 | namespace PR9336 { |
| 384 | template<class T> |
| 385 | struct generic_list |
| 386 | { |
| 387 | template<class Container> |
| 388 | operator Container() |
| 389 | { |
| 390 | Container ar; |
| 391 | T* i; |
| 392 | ar[0]=*i; |
| 393 | return ar; |
| 394 | } |
| 395 | }; |
| 396 | |
| 397 | template<class T> |
| 398 | struct array |
| 399 | { |
| 400 | T& operator[](int); |
| 401 | const T& operator[](int)const; |
| 402 | }; |
| 403 | |
| 404 | generic_list<generic_list<int> > l; |
| 405 | array<array<int> > a = l; |
| 406 | } |
Richard Smith | 48d2464 | 2011-07-13 22:53:21 +0000 | [diff] [blame] | 407 | |
| 408 | namespace PR8800 { |
| 409 | struct A; |
| 410 | struct C { |
| 411 | operator A&(); |
| 412 | }; |
| 413 | void f() { |
| 414 | C c; |
| 415 | A& a1(c); |
| 416 | A& a2 = c; |
| 417 | A& a3 = static_cast<A&>(c); |
| 418 | A& a4 = (A&)c; |
| 419 | } |
| 420 | } |
Richard Smith | 99fdf8d | 2012-05-06 00:04:32 +0000 | [diff] [blame] | 421 | |
| 422 | namespace PR12712 { |
| 423 | struct A {}; |
| 424 | struct B { |
| 425 | operator A(); |
| 426 | operator A() const; |
| 427 | }; |
| 428 | struct C : B {}; |
| 429 | |
| 430 | A f(const C c) { return c; } |
| 431 | } |
Richard Smith | 649c7b06 | 2014-01-08 00:56:48 +0000 | [diff] [blame] | 432 | |
| 433 | namespace PR18234 { |
| 434 | struct A { |
Ismail Pazarbasi | 025f428 | 2014-03-07 22:36:23 +0000 | [diff] [blame] | 435 | operator enum E { e } (); // expected-error {{'PR18234::A::E' cannot be defined in a type specifier}} |
| 436 | operator struct S { int n; } (); // expected-error {{'PR18234::A::S' cannot be defined in a type specifier}} |
Erik Verbruggen | 52b2671 | 2016-10-27 08:37:14 +0000 | [diff] [blame] | 437 | // expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'struct A' to 'const PR18234::A::S &' for 1st argument}} |
| 438 | #if __cplusplus >= 201103L |
| 439 | // expected-note@-3 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'struct A' to 'PR18234::A::S &&' for 1st argument}} |
| 440 | #endif |
Richard Smith | 649c7b06 | 2014-01-08 00:56:48 +0000 | [diff] [blame] | 441 | } a; |
Erik Verbruggen | 52b2671 | 2016-10-27 08:37:14 +0000 | [diff] [blame] | 442 | A::S s = a; // expected-error {{no viable conversion from 'struct A' to 'A::S'}} |
Richard Smith | 649c7b06 | 2014-01-08 00:56:48 +0000 | [diff] [blame] | 443 | A::E e = a; // expected-note {{here}} |
| 444 | bool k1 = e == A::e; // expected-error {{no member named 'e'}} |
| 445 | bool k2 = e.n == 0; |
| 446 | } |