[clang] [clang] Warn const integer-overflow of member in temporary struct bound to rvalue reference (PR #117225)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 21 23:27:06 PST 2024


================
@@ -12048,7 +12048,8 @@ void Sema::CheckForIntOverflow (const Expr *E) {
              New && New->isArray()) {
       if (auto ArraySize = New->getArraySize())
         Exprs.push_back(*ArraySize);
-    }
+    } else if (const auto *Mte = dyn_cast<MaterializeTemporaryExpr>(OriginalE))
+      Exprs.push_back(Mte->getSubExpr());
----------------
Sirraide wrote:

```suggestion
    } else if (const auto *MTE = dyn_cast<MaterializeTemporaryExpr>(OriginalE))
      Exprs.push_back(MTE->getSubExpr());
```
Actually, very small nit that I missed at first, but everything else lgtm.

https://github.com/llvm/llvm-project/pull/117225


More information about the cfe-commits mailing list