p3.cpp 659 B

12345678910111213141516171819202122232425262728293031
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // expected-no-diagnostics
  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. // From core issue 305
  10. struct A {
  11. };
  12. struct C {
  13. struct A {};
  14. void f ();
  15. };
  16. void C::f () {
  17. ::A *a;
  18. a->~A ();
  19. }
  20. // From core issue 414
  21. struct X {};
  22. void f() {
  23. X x;
  24. struct X {};
  25. x.~X();
  26. }