r347895 - Simplify the __builtin_constant_p test that was used to catch rC347417 failure

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 29 10:26:39 PST 2018


Author: maskray
Date: Thu Nov 29 10:26:39 2018
New Revision: 347895

URL: http://llvm.org/viewvc/llvm-project?rev=347895&view=rev
Log:
Simplify the __builtin_constant_p test that was used to catch rC347417 failure

Reviewers: rsmith, void, shafik

Reviewed By: void

Subscribers: kristina, cfe-commits

Differential Revision: https://reviews.llvm.org/D54964

Modified:
    cfe/trunk/test/SemaCXX/constant-expression-cxx1y.cpp

Modified: cfe/trunk/test/SemaCXX/constant-expression-cxx1y.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constant-expression-cxx1y.cpp?rev=347895&r1=347894&r2=347895&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/constant-expression-cxx1y.cpp (original)
+++ cfe/trunk/test/SemaCXX/constant-expression-cxx1y.cpp Thu Nov 29 10:26:39 2018
@@ -1123,10 +1123,7 @@ static_assert(e2.x != e2.y, "");
 
 } // namespace IndirectFields
 
-constexpr bool __constant_string_p(const char *__s) {
-  while (__builtin_constant_p(*__s) && *__s)
-    __s++;
+constexpr bool indirect_builtin_constant_p(const char *__s) {
   return __builtin_constant_p(*__s);
 }
-
-constexpr bool n = __constant_string_p("a");
+constexpr bool n = indirect_builtin_constant_p("a");




More information about the cfe-commits mailing list