[Bug c++/126615] [C++20] {} accepted as a template-argument for a template template parameter with a placeholder type

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]> Thu, 06 Aug 2026 05:25:55 +0000
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126615

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
I have to understand why a placeholder type would be any different from doing
something more explict like this:
```
template <int N> struct A {};
template <typename T, template <T> class TT> using G
   = TT<{}>;
using X = G<int, A>;
```
Which both clang and GCC accept.
EDG and MSVC rejects the above though (for different reasons; EDG rejects `{}`
as template argument in general as a parse error; MSVC rejects it for being an
invalid template template argument).

Note for the original testcase the error message from clang does not even makes
sense as the type of `{}` is not void.

<source>:5:9: error: non-type template parameter '' with type 'auto' has
incompatible initializer of type 'void'
    5 |    = TT<{}>;
      |         ^~