forked from OSchip/llvm-project
D31187: Fix removal of out-of-line definitions.
Consider: struct MyClass { void f() {} } MyClass::f(){} // expected error redefinition of f. #1 Some clients (eg. cling) need to call removeDecl for the redefined (#1) decl. This patch enables us to remove the lookup entry is registered in the semantic decl context and not in the primary decl context of the lexical decl context where we currently are trying to remove it from. It is not trivial to test this piece and writing a full-blown unit test seems too much. llvm-svn: 305799
This commit is contained in:
parent
e437b6a52b
commit
2e4159801d
|
@ -1352,7 +1352,7 @@ void DeclContext::removeDecl(Decl *D) {
|
|||
// Remove only decls that have a name
|
||||
if (!ND->getDeclName()) return;
|
||||
|
||||
auto *DC = this;
|
||||
auto *DC = D->getDeclContext();
|
||||
do {
|
||||
StoredDeclsMap *Map = DC->getPrimaryContext()->LookupPtr;
|
||||
if (Map) {
|
||||
|
|
Loading…
Reference in New Issue