[clang] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 24 10:09:48 PDT 2024
13steinj wrote:
> lambda can also appear as a part of the default argument, and that would make getTemplateInstantiationArgs provide extra template arguments in undesired contexts. This leads to issue https://github.com/llvm/llvm-project/issues/89853.
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.
```cpp
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;
```
https://github.com/llvm/llvm-project/pull/89934
More information about the cfe-commits
mailing list