================
@@ -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();
+ }
+ }
+
----------------
ArtyomZabroda wrote:
I don't understand how changing TTPDecl->setTypeForDecl to int can solve the
issue for constraints. If I remove the check for invalid decl that I've made in
EvaluateAtomicConstraint and set the type to int for the TemplateTypeParmDecl
as you suggested, then the same errors pop up in the compiler. I'm not
confident with the codebase yet, so maybe I've missed something, but I can't
see any code in CheckInstantiatedFunctionTemplateConstraints and functions
inside of it that checks dependence of a type inside TemplateTypeParmDecl
before substituting an argument.
https://github.com/llvm/llvm-project/pull/142278
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits