Skip to content

Commit 29bc3d3

Browse files
committed
fixup! [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated
1 parent 04e350f commit 29bc3d3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19856,12 +19856,7 @@ static void DoMarkVarDeclReferenced(
1985619856
// The size of an incomplete array type can be updated by
1985719857
// instantiating the initializer. The DeclRefExpr's type should be
1985819858
// updated accordingly too, or users of it would be confused!
19859-
//
19860-
// FIXME: Do we need to recompute the type for all the Decls, as in
19861-
// BuildDeclarationNameExpr?
19862-
if (SemaRef.Context.getAsIncompleteArrayType(DRE->getType()) &&
19863-
!SemaRef.Context.getAsIncompleteArrayType(Var->getType()))
19864-
DRE->setType(Var->getType());
19859+
SemaRef.getCompletedType(DRE);
1986519860
} else if (auto *ME = dyn_cast_or_null<MemberExpr>(E))
1986619861
ME->setMemberDecl(ME->getMemberDecl());
1986719862
} else if (FirstInstantiation) {

0 commit comments

Comments
 (0)