[clang] [Clang][Sema] Don't treat error-recovery dependence as genuine template dependence in ActOnTag (PR #221440)
Anirudh Mathur via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 19 02:41:43 PDT 2026
================
@@ -18373,7 +18356,14 @@ Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc,
if (TUK == TagUseKind::Friend || TUK == TagUseKind::Reference) {
DC = computeDeclContext(SS, false);
if (!DC) {
- IsDependent = true;
+ // This is a genuinely dependent nested-name-specifier (e.g. it
+ // depends on an uninstantiated template parameter), not one that
+ // merely appears dependent because of an embedded error-recovery
+ // placeholder. Only in that genuine case should we defer/treat this
+ // as a dependent name for the caller to handle.
+ const Type *T = SS.getScopeRep().getAsType();
+ IsDependent =
+ isDependentScopeSpecifier(SS) && (!T || !T->containsErrors());
----------------
anirudhmathur12 wrote:
Yeah, this seems to be better than my solution. I have implemented it, please go over it when you have a chance.
https://github.com/llvm/llvm-project/pull/221440
More information about the cfe-commits
mailing list