diff options
Diffstat (limited to 'clang/test/AST/ByteCode/builtin-functions.cpp')
-rw-r--r-- | clang/test/AST/ByteCode/builtin-functions.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp index 2981255..11ff48b 100644 --- a/clang/test/AST/ByteCode/builtin-functions.cpp +++ b/clang/test/AST/ByteCode/builtin-functions.cpp @@ -1459,6 +1459,11 @@ namespace Memchr { constexpr bool b = !memchr("hello", 'h', 3); // both-error {{constant expression}} \ // both-note {{non-constexpr function 'memchr' cannot be used in a constant expression}} + constexpr bool f() { + const char *c = "abcdef"; + return __builtin_char_memchr(c + 1, 'f', 1) == nullptr; + } + static_assert(f()); } namespace Strchr { |