[Bug c++/126615] New: [C++20] {} accepted as a template-argument for a template template parameter with a placeholder type
fchelnokov at gmail dot com via Gcc-bugs <[email protected]> Mon, 03 Aug 2026 12:11:45 +0000
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D126615
Bug ID: 126615
Summary: [C++20] {} accepted as a template-argument for a
template template parameter with a placeholder type
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
```
#include <initializer_list>
template <int N> struct A {};
template <template <auto> class TT> using G =3D TT<{}>;
using X =3D G<A>; // GCC accepts
```
auto cannot be deduced from an empty braced-init-list, so this should be
rejected. Clang, EDG and MSVC reject it; GCC also rejects the same parameter
written directly (template <auto V> struct Au {}; using X =3D Au<{}>;).
Dropping #include <initializer_list> makes GCC reject it too, with deducing
from brace-enclosed initializer list requires '#include <initializer_list>'=
-
yet no std::initializer_list takes part in the accepted path: TT becomes A,=
and
{} copy-initializes its int parameter.
Online demo: https://gcc.godbolt.org/z/jE4Tc1bb4=