================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to