1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
2 | // expected-no-diagnostics |
3 | |
4 | // C++0x [basic.lookup.classref]p3: |
5 | // If the unqualified-id is ~type-name, the type-name is looked up in the |
6 | // context of the entire postfix-expression. If the type T of the object |
7 | // expression is of a class type C, the type-name is also looked up in the |
8 | // scope of class C. At least one of the lookups shall find a name that |
9 | // refers to (possibly cv-qualified) T. |
10 | |
11 | // From core issue 305 |
12 | struct A { |
13 | }; |
14 | |
15 | struct C { |
16 | struct A {}; |
17 | void f (); |
18 | }; |
19 | |
20 | void C::f () { |
21 | ::A *a; |
22 | a->~A (); |
23 | } |
24 | |
25 | // From core issue 414 |
26 | struct X {}; |
27 | void f() { |
28 | X x; |
29 | struct X {}; |
30 | x.~X(); |
31 | } |
32 | |