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:
Christian Kandeler
2020-05-27 15:09:04 +02:00
parent 45b96d12e5
commit 1989dbe0d7
3 changed files with 4 additions and 2 deletions

View File

@@ -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();