================
@@ -7417,6 +7477,12 @@ ExprResult Sema::CheckTemplateArgument(NamedDecl *Param, 
QualType ParamType,
     if (Value.isAddrLabelDiff())
       return Diag(StartLoc, diag::err_non_type_template_arg_addr_label_diff);
 
+    if (ParamType->isRecordType() &&
+        !ParamType->isInstantiationDependentType() &&
----------------
mizvekov wrote:

I see.

In general, the only difference between an instantiation-dependent-only type 
and one which is not (but is still the same type as the former), is that the 
former still needs to be substituted later, and that might turn out to become 
an invalid type (and then trigger SFINAE or the program being rejected).

The reason we defer constraint checking in those cases is that it captures such 
a failure and turns that into a 'false' evaluation.

So we can gloss-over instantiation-dependence-only as long as we remember that 
original type, and will try to substitute it later, and will correctly deal 
with any subsequent failures.

So I'd expect we would create a `TemplateParamObjectDecl` with such a type, and 
then later substitute that, producing another `TemplateParamObjectDecl`. So any 
changes to the `Profile` function would not really be necessary, if I haven't 
misunderstood anything. Likewise, creating a `TemplateParamObjectDecl` with the 
canonical type would be unnecessary.

https://github.com/llvm/llvm-project/pull/193754
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to