Implement C++ [basic.lookup.classref]p3, which states how the type
name 'T' is looked up in the expression

  t.~T()

Previously, we weren't looking into the type of "t", and therefore
would fail when T actually referred to an injected-class-name. Fixes
PR5530.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89493 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/pseudo-destructors.cpp b/test/SemaCXX/pseudo-destructors.cpp
index 0850c44..8f69def 100644
--- a/test/SemaCXX/pseudo-destructors.cpp
+++ b/test/SemaCXX/pseudo-destructors.cpp
@@ -38,3 +38,12 @@
 void destroy_without_call(int *ip) {
   ip->~Integer; // expected-error{{called immediately}}
 }
+
+// PR5530
+namespace N1 {
+  class X0 { };
+}
+
+void test_X0(N1::X0 &x0) {
+  x0.~X0();
+}