This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]