[Bug c++/97401] static int has a default value?

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Oct 13 11:38:33 GMT 2020


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to tangyixuan from comment #0)
> Usually, it will has a default value '0', and thus 'b[a]' could be declared
> as b[0] perhaps.

But b[0] would be ill-formed. 

All compilers reject this if you actually instantiate the template, because
it's ill-formed.


More information about the Gcc-bugs mailing list