This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/72842] non-type template-parameter of type void
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 Aug 2016 19:45:31 +0000
- Subject: [Bug c++/72842] non-type template-parameter of type void
- Auto-submitted: auto-generated
- References: <bug-72842-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72842
--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Barry Revzin from comment #4)
> I'll just email. Instantiating foo<void> creates a function template with a
> non-type template parameter of type void. That's not an allowed type of a
> non-type template parameter, so I think it should be ill-formed.
It truely is ill-formed, but the question is whether an implementation is
required to diagnose it. For the non-depending case the diagnostics is a hard
requirement. But for the dependent case we have [temp.res] p8:
"The program is ill-formed, no diagnostic required, if:
[..]
— every valid specialization of a variadic template requires an empty template
parameter pack, or [..]"
My argument is that this is the case we are entering here: Ill-formed, but no
diagnostics required.