[clang] 4456076 - Revert "Further implement CWG 2292"
Amy Huang via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 15 15:46:36 PST 2020
Author: Amy Huang
Date: 2020-01-15T15:46:07-08:00
New Revision: 44560762c62d72a103bdceff49ffa70451efd5f8
URL: https://github.com/llvm/llvm-project/commit/44560762c62d72a103bdceff49ffa70451efd5f8
DIFF: https://github.com/llvm/llvm-project/commit/44560762c62d72a103bdceff49ffa70451efd5f8.diff
LOG: Revert "Further implement CWG 2292"
This reverts commit ee0f1f1edc3ec0d4e698d50cc3180217448802b7 because it
causes an error on valid code.
See https://reviews.llvm.org/rGee0f1f1edc3ec0d4e698d50cc3180217448802b7.
Added:
Modified:
clang/lib/Sema/SemaExprCXX.cpp
Removed:
clang/test/SemaCXX/pseudo-destructor-name.cpp
################################################################################
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 96e18105df78..a73e6906fceb 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<CXXRecordDecl>(DC)) {
- if ((RD->hasDefinition() && RD->hasSimpleDestructor()) ||
- !RD->hasDefinition())
- LookAtPrefix = false;
+ } else if (DC && isa<CXXRecordDecl>(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 cc7c22b8dc4d..000000000000
--- 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;
-}
More information about the cfe-commits
mailing list