This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23263] Incomprehensible message for invalid attempt to partially specialize a member
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Aug 2005 22:56:42 -0000
- Subject: [Bug c++/23263] Incomprehensible message for invalid attempt to partially specialize a member
- References: <20050806202324.23263.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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 ‘struct X<A, 1>’
x.cc:1: error: declaration of ‘struct X<A, 1>’
x.cc:2: error: template definition of non-template ‘void X<A, 1>::f()’
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