[PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

George Burgess IV via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 21:30:03 PDT 2016


george.burgess.iv added inline comments.

================
Comment at: test/SemaCXX/constant-expression-cxx1y.cpp:182
@@ -181,4 +181,3 @@
 
-  // FIXME: We should be able to reject this before it's called
-  constexpr void f() {
+  constexpr void f() { // expected-error{{constexpr function never produces a constant expression}} expected-note at +2{{assignment to dereferenced one-past-the-end pointer is not allowed in a constant expression}}
     char foo[10] = { "z" }; // expected-note {{here}}
----------------
Aside: This test was fixed because we no longer give up on trying to look up `foo`, because we know an unmodeled side-effect hasn't happened.


http://reviews.llvm.org/D18540





More information about the cfe-commits mailing list