declarations that are made visible after the dummy is parsed and ODR verified
Prior to this commit the
"(getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."),"
assertion failure was triggered during semantic analysis of the dummy
tag declaration that was declared in another tag declaration because its
lexical context did not point to the outer tag decl.
rdar://
32292196
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310706
91177308-0d34-0410-b5e6-
96231b3b80d8
// comparison.
SkipBody->CheckSameAsPrevious = true;
SkipBody->New = createTagFromNewDecl();
+ SkipBody->New->setLexicalDeclContext(CurContext);
SkipBody->Previous = Hidden;
} else {
SkipBody->ShouldSkip = true;
--- /dev/null
+struct Outer {
+// This definition is actually hidden since only submodule 'one' is imported.
+struct Inner {
+ int x;
+} field;
+};
module objcAtKeywordMissingEnd {
header "objcAtKeywordMissingEnd.h"
}
+
+module innerstructredef {
+ module one {
+ header "empty.h"
+ }
+ module two {
+ header "innerstructredef.h"
+ }
+}
--- /dev/null
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -verify %s
+// expected-no-diagnostics
+
+@import innerstructredef.one;
+
+struct Outer {
+// Should set lexical context when parsing 'Inner' here, otherwise there's a crash:
+struct Inner {
+ int x;
+} field;
+};