[PATCH] D129881: [C] Strengthen -Wint-conversion to default to an error

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 15 10:50:29 PDT 2022


erichkeane added a comment.

This seems like a good idea despite the breaking change.  I dont see anything in the code to be concerned about, but I'm hoping others will comment as to whether this is completely acceptable.



================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:8482
     ExprResult Res = TransformExpr(E);
-    if (Trap.hasErrorOccurred() || Res.isInvalid())
+    if ((SemaRef.getLangOpts().CPlusPlus && Trap.hasErrorOccurred()) ||
+        Res.isInvalid())
----------------
This makes sense to me, I don't see why this hasn't bit us before, but SFINAE in C mode seems wrong?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129881/new/

https://reviews.llvm.org/D129881



More information about the cfe-commits mailing list