Simplify the __builtin_constant_p test that was used to catch rC347417 failure
authorFangrui Song <maskray@google.com>
Thu, 29 Nov 2018 18:26:39 +0000 (18:26 +0000)
committerFangrui Song <maskray@google.com>
Thu, 29 Nov 2018 18:26:39 +0000 (18:26 +0000)
Reviewers: rsmith, void, shafik

Reviewed By: void

Subscribers: kristina, cfe-commits

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

llvm-svn: 347895

clang/test/SemaCXX/constant-expression-cxx1y.cpp

index 3214a2c..302b6cc 100644 (file)
@@ -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");