Skip to content

Commit 1274282

Browse files
committed
Fixed the unset value
1 parent 2d1cb40 commit 1274282

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5226,8 +5226,8 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const {
52265226

52275227
assert(KD != Kind::Max);
52285228

5229-
auto *Target = PredefinedSugarTypes[llvm::to_underlying(KD)];
5230-
if (Target != nullptr)
5229+
if (auto *Target = PredefinedSugarTypes[llvm::to_underlying(KD)];
5230+
Target != nullptr)
52315231
return QualType(Target, 0);
52325232

52335233
auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType {
@@ -5252,7 +5252,7 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const {
52525252
PredefinedSugarType(KD, &Idents.get(PredefinedSugarType::getName(KD)),
52535253
getCanonicalType(*this, static_cast<Kind>(KD)));
52545254
Types.push_back(New);
5255-
Target = New;
5255+
PredefinedSugarTypes[llvm::to_underlying(KD)] = New;
52565256
return QualType(New, 0);
52575257
}
52585258

0 commit comments

Comments
 (0)