brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 3241751 Raw
32 lines · cpp
1// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify -pedantic %s2// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -pedantic %s3// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -pedantic %s4// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify -pedantic %s5double e = 0x.p0; // expected-error-re {{hexadecimal floating {{constant|literal}} requires a significand}}6 7float f = 0x1p+1;8double d = 0x.2p2;9float g = 0x1.2p2;10double h = 0x1.p2;11#if __cplusplus <= 201402L12// expected-warning@-5 {{hexadecimal floating literals are a C++17 feature}}13// expected-warning@-5 {{hexadecimal floating literals are a C++17 feature}}14// expected-warning@-5 {{hexadecimal floating literals are a C++17 feature}}15// expected-warning@-5 {{hexadecimal floating literals are a C++17 feature}}16#endif17 18// PR12717: In order to minimally diverge from the C++ standard, we do not lex19// 'p[+-]' as part of a pp-number unless the token starts 0x and doesn't contain20// an underscore.21double i = 0p+3; // expected-error {{invalid suffix 'p' on integer constant}}22#define PREFIX(x) foo ## x23double foo0p = 1, j = PREFIX(0p+3); // ok24double k = 0x42_amp+3;25#if __cplusplus > 201402L26// expected-error@-2 {{no matching literal operator for call to 'operator""_amp+3'}}27#elif __cplusplus >= 201103L28// expected-error@-4 {{no matching literal operator for call to 'operator""_amp'}}29#else30// expected-error@-6 {{invalid suffix '_amp' on integer constant}}31#endif32