p3.cpp revision 8e8fb3be5bd78f0564444eca02b404566a5f3b5d
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
12struct A {
13};
14
15struct C {
16  struct A {};
17  void f ();
18};
19
20void C::f () {
21  ::A *a;
22  a->~A ();
23}
24
25// From core issue 414
26struct X {};
27void f() {
28  X x;
29  struct X {};
30  x.~X();
31}
32