[Bug c++/95807] GCC accepts "void value not ignored as it ought to be" in function template

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 22 09:46:27 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95807

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Haoxin Tu from comment #2)
> (In reply to Andrew Pinski from comment #1)
> > I think it is rejected at instanition time.
> 
> Hi, Andrew. Shouldn't it be rejected at compiling time?

It could be, but that is not required by the C++ standard.

> Is this case similar with bug.cc?

Yes. The ill-formed template is not diagnosed unless you instantiate it. That
is allowed by the standard.


More information about the Gcc-bugs mailing list