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++/23263] Incomprehensible message for invalid attempt to partially specialize a member


------- Additional Comments From bangerth at dealii dot org  2005-08-06 22:56 -------
If you know what's going on, the error message is actually clear:  
  foo.cc:7: error: invalid use of undefined type `struct bar<T, A>'  
This just means that the partially specialized class bar<T,A> has not  
yet been declared, and that you can't therefore define a member of it.  
  
But I grant that we could do better. For that purpose, this example 
may be better: 
--------------------- 
template <int A, int B> struct X { void f(); }; 
template <int A> void X<A,1>::f() {} 
--------------------- 
We presently get this: 
g/x> /home/bangerth/bin/gcc-4.1-pre/bin/c++ -c x.cc 
x.cc:2: error: invalid use of undefined type &#8216;struct X<A, 1>&#8217; 
x.cc:1: error: declaration of &#8216;struct X<A, 1>&#8217; 
x.cc:2: error: template definition of non-template &#8216;void X<A, 1>::f()&#8217; 
  
W.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-06 22:56:41
               date|                            |
            Summary|Fails to identify member    |Incomprehensible message for
                   |definition                  |invalid attempt to partially
                   |                            |specialize a member


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


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