================ @@ -0,0 +1,86 @@ +// RUN: %clang_cc1 -std=c2x -verify -triple x86_64 -pedantic -Wno-conversion -Wno-constant-conversion %s + +/* WG14 N3018: Full + * The constexpr specifier for object definitions + */ + +#define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL) +#define UINT_MAX (__INT_MAX__ *2U +1U) + +void Example0() { + constexpr unsigned int minusOne = -1; + // expected-error@-1 {{constexpr initializer evaluates to -1 which is not exactly representable in type 'unsigned int'}} + constexpr unsigned int uint_max = -1U; + constexpr double onethird = 1.0/3.0; + constexpr double onethirdtrunc = (double)(1.0/3.0); + + constexpr char string[] = { "\xFF", }; ---------------- AaronBallman wrote:
It'd be good to have a test with wide strings and another one with concatenated strings. e.g., ``` constexpr char string[] = "test""ing this out\xFF"; ``` https://github.com/llvm/llvm-project/pull/73099 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits