Home | History | Annotate | Download | only in basic.lookup.classref
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 // C++0x [basic.lookup.classref]p3:
      4 //   If the unqualified-id is ~type-name, the type-name is looked up in the
      5 //   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
     11 struct A {
     12 };
     13 
     14 struct C {
     15   struct A {};
     16   void f ();
     17 };
     18 
     19 void C::f () {
     20   ::A *a;
     21   a->~A ();
     22 }
     23 
     24 // From core issue 414
     25 struct X {};
     26 void f() {
     27   X x;
     28   struct X {};
     29   x.~X();
     30 }
     31