[clang] [Clang][Parse] Fix assertion when annotating a failed decltype-specifier (PR #211221)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 23 06:54:16 PDT 2026
================
@@ -1136,6 +1136,20 @@ void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec &DS,
// make sure we have a token we can turn into an annotation token
if (PP.isBacktrackEnabled()) {
PP.RevertCachedTokens(1);
+ if (DS.getTypeSpecType() == TST_error && PP.hasCachedTokenLocation()) {
----------------
AaronBallman wrote:
Why are we calling the annotation function at all if we have an invalid `DeclSpec`?
Have you tried fixing it from https://github.com/llvm/llvm-project/blob/aab7e0b08d30ddca5858069a4c14c1ea3da042e6/clang/lib/Parse/ParseExprCXX.cpp#L175 so we emit the diagnostic but don't try to handle it as a nested name specifier?
https://github.com/llvm/llvm-project/pull/211221
More information about the cfe-commits
mailing list