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 @@ -578,6 +578,9 @@ Improvements to Clang's diagnostics
578578
579579- Clang now omits shadowing warnings for parameter names in explicit object member functions (#GH95707).
580580
581+ - For an rvalue reference bound to a temporary struct with an integer member, Clang will detect constant integer overflow
582+ in the initializer for the integer member (#GH46755).
583+
581584Improvements to Clang's time-trace
582585----------------------------------
583586
Original file line number Diff line number Diff line change @@ -12048,7 +12048,8 @@ void Sema::CheckForIntOverflow (const Expr *E) {
1204812048 New && New->isArray()) {
1204912049 if (auto ArraySize = New->getArraySize())
1205012050 Exprs.push_back(*ArraySize);
12051- }
12051+ } else if (const auto *Mte = dyn_cast<MaterializeTemporaryExpr>(OriginalE))
12052+ Exprs.push_back(Mte->getSubExpr());
1205212053 } while (!Exprs.empty());
1205312054}
1205412055
Original file line number Diff line number Diff line change @@ -246,4 +246,10 @@ int m() {
246246 return 0 ;
247247}
248248}
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+ }
249255#endif
You can’t perform that action at this time.
0 commit comments