From 44560762c62d72a103bdceff49ffa70451efd5f8 Mon Sep 17 00:00:00 2001 From: Amy Huang Date: Wed, 15 Jan 2020 15:27:58 -0800 Subject: [PATCH] Revert "Further implement CWG 2292" This reverts commit ee0f1f1edc3ec0d4e698d50cc3180217448802b7 because it causes an error on valid code. See https://reviews.llvm.org/rGee0f1f1edc3ec0d4e698d50cc3180217448802b7. --- clang/lib/Sema/SemaExprCXX.cpp | 6 ++---- clang/test/SemaCXX/pseudo-destructor-name.cpp | 26 -------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 clang/test/SemaCXX/pseudo-destructor-name.cpp diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 96e1810..a73e690 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -192,10 +192,8 @@ ParsedType Sema::getDestructorName(SourceLocation TildeLoc, AlreadySearched = true; LookupCtx = DC; isDependent = false; - } else if (auto *RD = dyn_cast_or_null(DC)) { - if ((RD->hasDefinition() && RD->hasSimpleDestructor()) || - !RD->hasDefinition()) - LookAtPrefix = false; + } else if (DC && isa(DC)) { + LookAtPrefix = false; LookInScope = true; } diff --git a/clang/test/SemaCXX/pseudo-destructor-name.cpp b/clang/test/SemaCXX/pseudo-destructor-name.cpp deleted file mode 100644 index cc7c22b..0000000 --- a/clang/test/SemaCXX/pseudo-destructor-name.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -// expected-no-diagnostics - -struct AAA -{ - struct BBB - { - ~BBB() {} - }; - - typedef BBB BBB_alias; -}; - -typedef AAA::BBB BBB_alias2; - -int -main() -{ - AAA::BBB_alias *ptr1 = new AAA::BBB_alias(); - AAA::BBB_alias *ptr2 = new AAA::BBB_alias(); - - ptr1->AAA::BBB_alias::~BBB_alias(); // Now OK - ptr2->AAA::BBB_alias::~BBB(); // OK - ptr1->~BBB_alias2(); // OK - return 0; -} -- 2.7.4