blob: cd7e669527bcd8cf38e0be1f829c0fca177a04ae [file] [log] [blame]
Douglas Gregor46841e12010-02-23 00:15:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// C++0x [basic.lookup.classref]p3:
NAKAMURA Takumi9f8a02d2011-08-12 05:49:51 +00004// If the unqualified-id is ~type-name, the type-name is looked up in the
Douglas Gregor46841e12010-02-23 00:15:22 +00005// context of the entire postfix-expression. If the type T of the object
6// expression is of a class type C, the type-name is also looked up in the
7// scope of class C. At least one of the lookups shall find a name that
8// refers to (possibly cv-qualified) T.
9
10// From core issue 305
11struct A {
12};
13
14struct C {
15 struct A {};
16 void f ();
17};
18
19void C::f () {
20 ::A *a;
21 a->~A ();
22}
23
24// From core issue 414
25struct X {};
26void f() {
27 X x;
28 struct X {};
29 x.~X();
30}