From 92ce2aff680e31a726c17267e36ff13a1ef31696 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 2 Dec 2019 16:25:23 +0100 Subject: Actually delay processing DelayedDllExportClasses until the outermost class is finished (PR40006) This was already the intention of DelayedDllExportClasses, but code such as this would break it: template struct Tmpl {}; struct Outer { struct Inner { __declspec(dllexport) Inner() = default; unsigned int x = 0; }; Tmpl y; }; ActOnFinishCXXNonNestedClass() would get called when the instantiation of Templ is finished, even though the compiler is still not finished with Outer, causing the compile fail. This hooks into Sema::{Push,Pop}ParsingClass() to avoid calling ActOnFinishCXXNonNestedClass() for template instantiations while a class is being parsed. Differential revision: https://reviews.llvm.org/D70905 --- clang/lib/Parse/ParseDeclCXX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Parse/ParseDeclCXX.cpp') diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index c6ffbfc968d..fe409327bfb 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -3367,7 +3367,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, // We've finished parsing everything, including default argument // initializers. - Actions.ActOnFinishCXXNonNestedClass(TagDecl); + Actions.ActOnFinishCXXNonNestedClass(); } if (TagDecl) -- cgit v1.2.3