[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / AST / ByteCode / builtin-constant-p.cpp
blob0d222d1c962778570e75d8930fc54550bf2027ad
1 // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both %s
2 // RUN: %clang_cc1 -verify=ref,both %s
5 static_assert(__builtin_constant_p(12), "");
6 static_assert(__builtin_constant_p(1.0), "");
8 constexpr int I = 100;
9 static_assert(__builtin_constant_p(I), "");
10 static_assert(__builtin_constant_p(I + 10), "");
11 static_assert(__builtin_constant_p(I + 10.0), "");
12 static_assert(__builtin_constant_p(nullptr), "");
13 static_assert(__builtin_constant_p(&I), ""); // both-error {{failed due to requirement}}
14 static_assert(__builtin_constant_p((void)I), ""); // both-error {{failed due to requirement}}