diff options
Diffstat (limited to 'src/libs/3rdparty/cplusplus')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Lexer.cpp | 12 | ||||
-rw-r--r-- | src/libs/3rdparty/cplusplus/Token.h | 1 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp index 079ae0ca6e..d1858f007c 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.cpp +++ b/src/libs/3rdparty/cplusplus/Lexer.cpp @@ -954,7 +954,8 @@ void Lexer::scanNumericLiteral(Token *tok) yyinp(); while (std::isdigit(_yychar) || (_yychar >= 'a' && _yychar <= 'f') || - (_yychar >= 'A' && _yychar <= 'F')) { + (_yychar >= 'A' && _yychar <= 'F') || + ((_yychar == '\'') && _languageFeatures.cxx14Enabled)) { yyinp(); } if (!scanOptionalIntegerSuffix()) @@ -962,7 +963,8 @@ void Lexer::scanNumericLiteral(Token *tok) goto theEnd; } else if (_yychar == 'b' || _yychar == 'B') { // see n3472 yyinp(); - while (_yychar == '0' || _yychar == '1') + while (_yychar == '0' || _yychar == '1' || + ((_yychar == '\'') && _languageFeatures.cxx14Enabled)) yyinp(); if (!scanOptionalIntegerSuffix()) scanOptionalUserDefinedLiteral(tok); @@ -970,7 +972,8 @@ void Lexer::scanNumericLiteral(Token *tok) } else if (_yychar >= '0' && _yychar <= '7') { do { yyinp(); - } while (_yychar >= '0' && _yychar <= '7'); + } while ((_yychar >= '0' && _yychar <= '7') || + ((_yychar == '\'') && _languageFeatures.cxx14Enabled)); if (!scanOptionalIntegerSuffix()) scanOptionalUserDefinedLiteral(tok); goto theEnd; @@ -989,7 +992,8 @@ void Lexer::scanNumericLiteral(Token *tok) if (scanExponentPart() && !scanOptionalFloatingSuffix()) scanOptionalUserDefinedLiteral(tok); break; - } else if (std::isdigit(_yychar)) { + } else if (std::isdigit(_yychar) || + ((_yychar == '\'') && _languageFeatures.cxx14Enabled)) { yyinp(); } else { if (!scanOptionalIntegerSuffix()) diff --git a/src/libs/3rdparty/cplusplus/Token.h b/src/libs/3rdparty/cplusplus/Token.h index 67378b28a3..36a893efff 100644 --- a/src/libs/3rdparty/cplusplus/Token.h +++ b/src/libs/3rdparty/cplusplus/Token.h @@ -437,6 +437,7 @@ struct LanguageFeatures unsigned int qtKeywordsEnabled : 1; // If Qt is used but QT_NO_KEYWORDS defined unsigned int cxxEnabled : 1; unsigned int cxx11Enabled : 1; + unsigned int cxx14Enabled : 1; unsigned int objCEnabled : 1; unsigned int c99Enabled : 1; }; |