[Bug c++/13902] Misleading diagnostic for static data member definition

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Jan 28 21:55:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-28 21:54 -------
The mainline gives:
pr13902.cc:5: error: `T' was not declared in this scope
pr13902.cc:9: error: conflicting declaration 'char X< <template-parameter-1-1> >::buf[(sizeof (T) 
* X< <template-parameter-1-1> >::S)]'
pr13902.cc:5: error: 'X< <template-parameter-1-1> >::buf' has a previous declaration as `char 
X< <template-parameter-1-1> >::buf[(<expression error> * X< <template-parameter-1-1> >::
S)]'
pr13902.cc:9: error: template definition of non-template `char X< <template-parameter-1-1> >::
buf[(sizeof (T) * X< <template-parameter-1-1> >::S)]'

While 2.95.3 to 3.3.3 gives about the same
from 2.95.3:
pr13902.cc:9: conflicting types for `char X<{anonymous template type parm}>::buf[(sizeof (T) * 
X<{anonymous template type parm}>::S)]'
pr13902.cc:5: previous declaration as `char X<{anonymous template type parm}>::buf[(sizeof 
((*T)) * X<{anonymous template type parm}>::S)]'
>From 3.3:
pr13902.cc:9: error: conflicting types for `char X<<anonymous template type 
   parameter> >::buf[(sizeof (T) * X<<anonymous template type parameter> >::S)]
   '
pr13902.cc:5: error: previous declaration as `char X<<anonymous template type 
   parameter> >::buf[(sizeof ((*T)) * X<<anonymous template type parameter> 
   >::S)]'

I do not know if you would count this as fixed though, I am leaving it up to you, Gaby or someone 
else.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13902



More information about the Gcc-bugs mailing list