================
@@ -220,6 +220,14 @@ static ExprResult EvaluateAtomicConstraint(
     if (Inst.isInvalid())
       return ExprError();
 
+    if (const TemplateTypeParmType *TTPT =
+        
dyn_cast<TemplateTypeParmType>(AtomicExpr->getType().getDesugaredType(S.Context)))
 {
+      TemplateTypeParmDecl *TTPD = TTPT->getDecl();
+      if (TTPD->isInvalidDecl()) {
+        return ExprError();
+      }
+    }
+
----------------
mizvekov wrote:

If you change the type for the TTPDecl to int, then that changes the type 
produced whenever a typename lookup is performed for that template parameter 
name, and the TTPDecl essentially becomes unreachable within the program. So 
any users of T wouldn't be able to figure out there was a template parameter 
there, and should see no dependency.

I suspect you might not be changing the type early enough, the type should be 
changed as soon as we figure out we are getting into a struct definition, 
before the template parameter could be used as a base class, inside an 
attribute, or in the class body.

https://github.com/llvm/llvm-project/pull/142278
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to