zyn0217 wrote:

So, here is the offending case:

```cpp
template <class>
concept True = true;

template <class... U>
using MeowMeow = decltype([]<True>(U...) {}.template operator()<char>(U()...));

void foo() {
  using T = MeowMeow<char, int, long, unsigned>;
}
```

In this example, the lambda does not have the `TypeAliasTemplateDecl` where it 
is defined as its DeclContext - the `TypeAliasTemplateDecl` / `TypeAliasDecl` 
does not constitute a DeclContext. So, it's owned by TranslationUnitDecl. OTOH, 
we will instantiate the lambda inside the function `foo()` and thus the 
DeclContext of the instantiation is `foo()`, hence the discrepancy.

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

Reply via email to