[PATCH] C++11: Reject string literal to non-const char * conversion

Richard Smith richard at metafoo.co.uk
Thu Oct 17 16:08:07 PDT 2013


  Is there any way we can continue to accept this as an extension in C++11 mode (at least in easy cases, outside of SFINAE contexts)? I'm concerned that this may break a lot of existing code.


================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:2586-2587
@@ -2585,2 +2585,4 @@
 TEST(FunctionalCast, MatchesSimpleCase) {
+  // ill-formed in C++11
   std::string foo_class = "class Foo { public: Foo(char*); };";
+  EXPECT_TRUE(matchesConditionally(foo_class +
----------------
Can you change this to take `const char*` instead?


http://llvm-reviews.chandlerc.com/D1965



More information about the cfe-commits mailing list