diff options
Diffstat (limited to 'test/Lexer/hexfloat.cpp')
-rw-r--r-- | test/Lexer/hexfloat.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Lexer/hexfloat.cpp b/test/Lexer/hexfloat.cpp index 6566933..9bd8f83 100644 --- a/test/Lexer/hexfloat.cpp +++ b/test/Lexer/hexfloat.cpp @@ -5,3 +5,11 @@ double e = 0x.p0; //expected-error{{hexadecimal floating constants require a sig double d = 0x.2p2; // expected-warning{{hexadecimal floating constants are a C99 feature}} float g = 0x1.2p2; // expected-warning{{hexadecimal floating constants are a C99 feature}} double h = 0x1.p2; // expected-warning{{hexadecimal floating constants are a C99 feature}} + +// PR12717: In order to minimally diverge from the C++ standard, we do not lex +// 'p[+-]' as part of a pp-number unless the token starts 0x and doesn't contain +// an underscore. +double i = 0p+3; // expected-error{{invalid suffix 'p' on integer constant}} +#define PREFIX(x) foo ## x +double foo0p = 1, j = PREFIX(0p+3); // ok +double k = 0x42_amp+3; // expected-error-re{{invalid suffix '_amp' on integer constant|no matching literal operator for call to 'operator "" _amp'}} |