arphaman marked an inline comment as done.
arphaman added a comment.

In https://reviews.llvm.org/D37341#869042, @vsapsai wrote:

> Does your fix work for deeper nesting too (e.g. template in template in 
> template)? Looks like it should, just want to confirm.


Yes.

> Are there other places where you need to avoid calling 
> `DeduceTemplateArguments` due to templates depth mismatch? 
> `CheckDependentFunctionTemplateSpecialization` should be OK as it's not 
> deducing template arguments. But I'm not sure about 
> `CheckMemberSpecialization`. It doesn't call `DeduceTemplateArguments` 
> directly but I haven't dug deep enough to confirm it's not performing 
> deduction indirectly.

The problem only seems to happen when the TPL is fabricated. I didn't see other 
potential places where such an issue might happen.



================
Comment at: lib/Sema/SemaDecl.cpp:8880-8881
           << NewFD->getDeclName();
-      } else if (CheckFunctionTemplateSpecialization(NewFD,
+      } else if (!HasFabricatedTemplateSpecializationTemplateParams &&
+                 CheckFunctionTemplateSpecialization(NewFD,
                                   (HasExplicitTemplateArgs ? &TemplateArgs
----------------
vsapsai wrote:
> Will something more general like
> 
>     !NewFD->isInvalidDecl() && CheckFunctionTemplateSpecialization(...)
> 
> work here? Because if matching template parameters to scope specifier fails, 
> `NewFD` is marked as invalid decl and seems like we can use that.
Yeah, good idea.


Repository:
  rL LLVM

https://reviews.llvm.org/D37341



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to