[PATCH] D23493: Fix PR28366: Teach the const-expression evaluator to be more fault tolerant with non-const enclosing local variables, or otherwise fold them if const.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 22 16:53:22 PDT 2016


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!


================
Comment at: test/SemaCXX/constant-expression-cxx11.cpp:2091
@@ +2090,3 @@
+  };
+  static_assert(X::f() == c + d,"");
+}
----------------
I would use `'c' + 'd'` here, just in case we get the same incorrect value evaluating one of these in both places. (That is, if `d` incorrectly evaluated to `0` both here and on line 2088, this assert would still pass.)


https://reviews.llvm.org/D23493





More information about the cfe-commits mailing list