Files
llvm/clang/include
Oleksandr T. c128fd9beb [Clang] prevent crash on invalid nested name specifiers with a single colon (#169246)
Fixes #167905

--- 

This patch addresses an issue where invalid nested name specifier
sequences containing a single colon (`a:c::`) could be treated during
recovery as valid scope specifiers, which in turn led to a crash


c543615744/clang/lib/Parse/ParseExprCXX.cpp (L404-L418)


For malformed inputs like `a:c::`, the single colon recovery incorrectly
triggers and produces an `annot_cxxscope`. When tentative parsing later
runs


996213c6ea/clang/lib/Parse/ParseTentative.cpp (L1739-L1740)

the classifier returns `Ambiguous`, which doesn't stop parsing. The
parser then enters the


996213c6ea/clang/lib/Parse/ParseTentative.cpp (L1750-L1752)

and consumes the invalid scope annotation, eventually reaching `EOF` and
crashing.
2025-12-03 17:24:33 +02:00
..