File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -580,6 +580,9 @@ Improvements to Clang's diagnostics
580
580
581
581
- Improved error recovery for function call arguments with trailing commas (#GH100921).
582
582
583
+ - For an rvalue reference bound to a temporary struct with an integer member, Clang will detect constant integer overflow
584
+ in the initializer for the integer member (#GH46755).
585
+
583
586
Improvements to Clang's time-trace
584
587
----------------------------------
585
588
Original file line number Diff line number Diff line change @@ -12048,7 +12048,8 @@ void Sema::CheckForIntOverflow (const Expr *E) {
12048
12048
New && New->isArray()) {
12049
12049
if (auto ArraySize = New->getArraySize())
12050
12050
Exprs.push_back(*ArraySize);
12051
- }
12051
+ } else if (const auto *MTE = dyn_cast<MaterializeTemporaryExpr>(OriginalE))
12052
+ Exprs.push_back(MTE->getSubExpr());
12052
12053
} while (!Exprs.empty());
12053
12054
}
12054
12055
Original file line number Diff line number Diff line change @@ -246,4 +246,10 @@ int m() {
246
246
return 0 ;
247
247
}
248
248
}
249
+
250
+ namespace GH46755 {
251
+ void f () {
252
+ struct { int v; } &&r = {512 * 1024 * 1024 * 1024 }; // expected-warning {{overflow in expression; result is 0 with type 'int'}}
253
+ }
254
+ }
249
255
#endif
You can’t perform that action at this time.
0 commit comments