Skip to content

Commit 500d870

Browse files
Multi-decl rewriting should not try to split a struct forward
declaration as if it were a definition. Fixes #644.
1 parent 9af2fe9 commit 500d870

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/3C/DeclRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ void DeclRewriter::rewriteFunctionDecl(FunctionDeclReplacement *N) {
535535
/*static*/ std::set<Decl *> DeclRewriter::InlineVarDecls;
536536
void DeclRewriter::detectInlineStruct(Decl *D, SourceManager &SM) {
537537
RecordDecl *RD = dyn_cast<RecordDecl>(D);
538-
if (RD != nullptr &&
538+
if (RD != nullptr && RD->isCompleteDefinition() &&
539539
// With -fms-extensions (default on Windows), Clang injects an implicit
540540
// `struct _GUID` with an invalid location, which would cause an assertion
541541
// failure in SM.isPointWithin below.

0 commit comments

Comments
 (0)