diff options
Diffstat (limited to 'clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp')
-rw-r--r-- | clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp b/clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp new file mode 100644 index 0000000..43f3468 --- /dev/null +++ b/clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s + +int &operator "" _x1 (unsigned long long); +int &i1 = 0x123_x1; + +double &operator "" _x1 (const char *); +int &i2 = 45_x1; + +template<char...> char &operator "" _x1 (); +int &i3 = 0377_x1; + +int &i4 = 90000000000000000000000000000000000000000000000_x1; // expected-warning {{integer constant is too large}} + +double &operator "" _x2 (const char *); +double &i5 = 123123123123123123123123123123123123123123123_x2; + +template<char...Cs> constexpr int operator "" _x3() { return sizeof...(Cs); } +static_assert(123456789012345678901234567890123456789012345678901234567890_x3 == 60, ""); |