Issue |
123414
|
Summary |
Aliases and uniqueness of lambda in default argument of a class template parameter
|
Labels |
clang:frontend,
diverges-from:gcc,
diverges-from:msvc,
diverges-from:edg
|
Assignees |
|
Reporter |
cor3ntin
|
Consider
```cpp
template<typename T, typename F = decltype([](){} )>
struct Type {};
template<typename A>
using C = Type<A>;
static_assert(std::same_as<Type<int>,Type<int>>); // #1
static_assert(std::same_as<C<int>,C<int>>); // #2
```
https://godbolt.org/z/6ofdP1bPz
All compilers reject #1. Only clang reject #2.
This seems vaguely related, but distinct from
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2794
Given https://eel.is/c++draft/temp.alias#2
> When a template-id refers to the specialization of an alias template, it is equivalent to the associated type obtained by substitution of its template-arguments for the template-parameters in the defining-type-id of the alias template.
And https://eel.is/c++draft/temp#arg.general-9.sentence-1
> When a simple-template-id does not name a function, a default template-argument is implicitly instantiated when the value of that default argument is needed.
It's clear as mud (to me) what the expected behavior should be. I'll contact CWG
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs