Skip to content

Commit fc14083

Browse files
BuildDeclRefExpr should not fail
1 parent da2bbf9 commit fc14083

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,13 +1246,8 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
12461246
DeclRefExpr *Ref =
12471247
BuildDeclRefExpr(OrigConstrainedParm, OrigConstrainedParm->getType(),
12481248
VK_PRValue, OrigConstrainedParm->getLocation());
1249-
if (!Ref) {
1250-
NewConstrainedParm->setPlaceholderTypeConstraint(
1251-
RecoveryExpr::Create(Context, OrigConstrainedParm->getType(),
1252-
OrigConstrainedParm->getBeginLoc(),
1253-
OrigConstrainedParm->getEndLoc(), {}));
1254-
return true;
1255-
}
1249+
assert(Ref != nullptr && "Unexpected nullptr!");
1250+
12561251
ExprResult ImmediatelyDeclaredConstraint = formImmediatelyDeclaredConstraint(
12571252
*this, TL.getNestedNameSpecifierLoc(), TL.getConceptNameInfo(),
12581253
TL.getNamedConcept(), /*FoundDecl=*/TL.getFoundDecl(), TL.getLAngleLoc(),

0 commit comments

Comments
 (0)