forked from qt-creator/qt-creator
Built-in lexer: Recognize also reserved user-defined literals
Otherwise, we trip over uses of operators from the standard
library such as std::chrono's operator"" ms(), potentially breaking
basic code navigation.
Amends 425811291d.
Fixes: QTCREATORBUG-24067
Change-Id: I3b2863ce88ee3787414e7a1acdf25f368041cdb4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
2
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
2
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -939,7 +939,7 @@ bool Lexer::scanOptionalIntegerSuffix(bool allowU)
|
||||
|
||||
void Lexer::scanOptionalUserDefinedLiteral(Token *tok)
|
||||
{
|
||||
if (_languageFeatures.cxx11Enabled && _yychar == '_') {
|
||||
if (_languageFeatures.cxx11Enabled && (_yychar == '_' || std::isalpha(_yychar))) {
|
||||
tok->f.userDefinedLiteral = true;
|
||||
while (std::isalnum(_yychar) || _yychar == '_' || isByteOfMultiByteCodePoint(_yychar))
|
||||
yyinp();
|
||||
|
||||
Reference in New Issue
Block a user