zyn0217 wrote:

> FYI in my issue, even if the lambda didn't appear as part of the default 
> argument, I was [still able to trigger the 
> bug](https://godbolt.org/z/4KrEMTTdd). Noting in case this fix only resolves 
> the case of lambdas in default template arguments, and not passed in 
> explicitly.
> 
> e.g.
> 
> ```c++
> static constexpr auto not_default_now = []<const char c> {
>     (void) static_cast<char>(c);
> };
> 
> template<auto Pred>
> using broken = decltype(Pred.template operator()<'\0'>());
> 
> broken<not_default_now>* boom;
> ```

Yeah, this patch *fixes* that as well. To clarify, the issue was caused by 
having extra template arguments in the context where we don't actually expect 
them. For example, the problem arose from the argument for `Pred` when it was 
substituted before we exercise `DeduceReturnType` for the lambda 
`not_default_now`. This patch now avoids that fault and only offers complete 
arguments relative to the primary template while checking constraints - this 
matches what our constraint checking expects.

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

Reply via email to