diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -1971,6 +1971,10 @@ return LexNumericConstant(Result, CurPtr); if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr)) return LexNumericConstant(Result, CurPtr); + if (C == '$' && LangOpts.DollarIdents) { + CurPtr = ConsumeChar(CurPtr, Size, Result); + return LexNumericConstant(Result, CurPtr); + } // Update the location of token as well as BufferPtr. const char *TokStart = BufferPtr; diff --git a/clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp b/clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp --- a/clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp +++ b/clang/test/CXX/lex/lex.literal/lex.ext/p3.cpp @@ -16,3 +16,6 @@ template constexpr int operator "" _x3() { return sizeof...(Cs); } static_assert(123456789012345678901234567890123456789012345678901234567890_x3 == 60, ""); + +int operator "" _$ (unsigned long long); +int i6 = 42_$;