================ @@ -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:
You are right, I didn't change the type early enough, and after I did everything worked as expected. However, I've encountered a problem while implementing this fix. ParseAliasDeclarationAfterDeclarator initially parses an invalid struct and only then it checks whether the struct definition should be here in the first place. The problem is that I don't know of any nice way to obtain the template parameters of an alias while building a struct definition. In a new commit, I've used an improper way of passing template parameters to check if it fixes the issue. Maybe it would be better not to change the type as soon as getting into the struct definition, but instead to let it build itself improperly, and then when we figure out that struct definition shouldn't be there use TreeTransform to change this struct? 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