@@ -15189,39 +15189,39 @@ void Sema::CheckBoolLikeConversion(Expr *E, SourceLocation CC) {
15189
15189
15190
15190
/// Diagnose when expression is an integer constant expression and its evaluation
15191
15191
/// results in integer overflow
15192
- void Sema::CheckForIntOverflow (Expr *E) {
15192
+ void Sema::CheckForIntOverflow (const Expr *E) {
15193
15193
// Use a work list to deal with nested struct initializers.
15194
- SmallVector<Expr *, 2> Exprs(1, E);
15194
+ SmallVector<const Expr *, 2> Exprs(1, E);
15195
15195
15196
15196
do {
15197
- Expr *OriginalE = Exprs.pop_back_val();
15198
- Expr *E = OriginalE->IgnoreParenCasts();
15197
+ const Expr *OriginalE = Exprs.pop_back_val();
15198
+ const Expr *E = OriginalE->IgnoreParenCasts();
15199
15199
15200
15200
if (isa<BinaryOperator, UnaryOperator>(E)) {
15201
15201
E->EvaluateForOverflow(Context);
15202
15202
continue;
15203
15203
}
15204
15204
15205
- if (auto InitList = dyn_cast<InitListExpr>(OriginalE))
15205
+ if (const auto * InitList = dyn_cast<InitListExpr>(OriginalE))
15206
15206
Exprs.append(InitList->inits().begin(), InitList->inits().end());
15207
15207
else if (isa<ObjCBoxedExpr>(OriginalE))
15208
15208
E->EvaluateForOverflow(Context);
15209
- else if (auto Call = dyn_cast<CallExpr>(E))
15209
+ else if (const auto * Call = dyn_cast<CallExpr>(E))
15210
15210
Exprs.append(Call->arg_begin(), Call->arg_end());
15211
- else if (auto Message = dyn_cast<ObjCMessageExpr>(E))
15211
+ else if (const auto * Message = dyn_cast<ObjCMessageExpr>(E))
15212
15212
Exprs.append(Message->arg_begin(), Message->arg_end());
15213
- else if (auto Construct = dyn_cast<CXXConstructExpr>(E))
15213
+ else if (const auto * Construct = dyn_cast<CXXConstructExpr>(E))
15214
15214
Exprs.append(Construct->arg_begin(), Construct->arg_end());
15215
- else if (auto Temporary = dyn_cast<CXXBindTemporaryExpr>(E))
15215
+ else if (const auto * Temporary = dyn_cast<CXXBindTemporaryExpr>(E))
15216
15216
Exprs.push_back(Temporary->getSubExpr());
15217
- else if (auto Array = dyn_cast<ArraySubscriptExpr>(E))
15217
+ else if (const auto * Array = dyn_cast<ArraySubscriptExpr>(E))
15218
15218
Exprs.push_back(Array->getIdx());
15219
- else if (auto Compound = dyn_cast<CompoundLiteralExpr>(E))
15219
+ else if (const auto * Compound = dyn_cast<CompoundLiteralExpr>(E))
15220
15220
Exprs.push_back(Compound->getInitializer());
15221
- else if (auto New = dyn_cast<CXXNewExpr>(E)) {
15222
- if ( New->isArray())
15223
- if (auto ArraySize = New->getArraySize())
15224
- Exprs.push_back(*ArraySize);
15221
+ else if (const auto * New = dyn_cast<CXXNewExpr>(E);
15222
+ New && New ->isArray()) {
15223
+ if (auto ArraySize = New->getArraySize())
15224
+ Exprs.push_back(*ArraySize);
15225
15225
}
15226
15226
} while (!Exprs.empty());
15227
15227
}
0 commit comments