[clang] [Clang] Fix crash when type-name is combined with class specifier in template argument (PR #191689)

via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 18 21:51:52 PDT 2026


================
@@ -761,6 +761,7 @@ bool DeclSpec::SetTypeSpecType(TST T, SourceLocation TagKwLoc,
   if (TypeSpecType != TST_unspecified) {
     PrevSpec = DeclSpec::getSpecifierName((TST) TypeSpecType, Policy);
     DiagID = diag::err_invalid_decl_spec_combination;
+    TypeScope.clear();
     return true;
----------------
TPPPP72 wrote:

@ojhunt If we do this, it means we need to change the original static function to a function held by the DeclSpec class or pass a reference to DeclSpec. However, either way involves modifying the function signature. I think changing it to a member function might be more feasible. What do you think?

https://github.com/llvm/llvm-project/pull/191689


More information about the cfe-commits mailing list