Skip to content

Commit a96772e

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

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

0 commit comments

Comments
 (0)