This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13902] Misleading diagnostic for static data member definition
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jan 2004 22:04:45 -0000
- Subject: [Bug c++/13902] Misleading diagnostic for static data member definition
- References: <20040128214801.13902.gdr@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-01-28 22:04 -------
Subject: Re: Misleading diagnostic for static data member definition
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| 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)]'
[...]
| I do not know if you would count this as fixed though, I am leaving
| it up to you, Gaby or someone else.
Thanks for the quick testing. I made an error: the template parameter
should not be missing. E.g. the testcase should have been
template<class T>
struct X {
enum { S = 8};
static char buf[sizeof (T) * S];
};
template<class T>
char X<T>::buf[sizeof (T) * X<T>::S];
With this corrected version, the code is still rejected.
Sorry for the confusion.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13902