Skip to content

Commit b183451

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

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
@@ -557,7 +557,7 @@ void DeclRewriter::rewriteFunctionDecl(FunctionDeclReplacement *N) {
557557
/*static*/ std::set<Decl *> DeclRewriter::InlineVarDecls;
558558
void DeclRewriter::detectInlineStruct(Decl *D, SourceManager &SM) {
559559
RecordDecl *RD = dyn_cast<RecordDecl>(D);
560-
if (RD != nullptr &&
560+
if (RD != nullptr && RD->isCompleteDefinition() &&
561561
// With -fms-extensions (default on Windows), Clang injects an implicit
562562
// `struct _GUID` with an invalid location, which would cause an assertion
563563
// failure in SM.isPointWithin below.

0 commit comments

Comments
 (0)