Update diagnostics now that hexadecimal literals look likely to be part of C++17.
llvm-svn: 262753
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index d0e38a4..52146d7 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -1607,14 +1607,15 @@
// If we have a hex FP constant, continue.
if ((C == '-' || C == '+') && (PrevCh == 'P' || PrevCh == 'p')) {
- // Outside C99, we accept hexadecimal floating point numbers as a
+ // Outside C99 and C++17, we accept hexadecimal floating point numbers as a
// not-quite-conforming extension. Only do so if this looks like it's
// actually meant to be a hexfloat, and not if it has a ud-suffix.
bool IsHexFloat = true;
if (!LangOpts.C99) {
if (!isHexaLiteral(BufferPtr, LangOpts))
IsHexFloat = false;
- else if (std::find(BufferPtr, CurPtr, '_') != CurPtr)
+ else if (!getLangOpts().CPlusPlus1z &&
+ std::find(BufferPtr, CurPtr, '_') != CurPtr)
IsHexFloat = false;
}
if (IsHexFloat)