This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11711] Inheritance from partially specialized template does not work
- From: "furnish at lightspeed dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jul 2003 21:37:18 -0000
- Subject: [Bug c++/11711] Inheritance from partially specialized template does not work
- References: <20030729191159.11711.furnish@lightspeed.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11711
furnish at lightspeed dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
------- Additional Comments From furnish at lightspeed dot com 2003-07-29 21:37 -------
I stand corrected. And thanks for pointing me to the explanation, as it was
good to be reminded of that.
However, if I make the suggested correction to the call site to make
the reference dependent, GCC still fails to compile the (corrected) code.
For example, if we try
template<class H, class T>
class Derived
: public Base< TL<H,T> >
{
public:
void g()
{
this->f<1>();
}
};
Then gcc 3.3.1 (prerelease) gives:
/opt/gcc-3.3.1/bin/c++ -v -c x.cc
Reading specs from /opt/gcc-3.3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
Configured with: ./configure --prefix=/opt/gcc-3.3.1 : (reconfigured)
./configure --prefix=/opt/gcc-3.3.1 --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.3.1 20030720 (prerelease)
...
x.cc: In member function `void Derived<H, T>::g()':
x.cc:20: error: parse error before `;' token
which I think is the same error message as before, and gcc 3.4 (cvs head) gives:
/opt/gcc-3.4/bin/c++ -v -c x.cc
Reading specs from /opt/gcc-3.4/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ./configure --prefix=/opt/gcc-3.4 : (reconfigured) ./configure
--prefix=/opt/gcc-3.4 --enable-languages=c,c++,f77,java
Thread model: posix
gcc version 3.4 20030729 (experimental)
...
x.cc: In member function `void Derived<H, T>::g()':
x.cc:20: error: expected primary-expression
Similarly, if we qualify the call site in this way:
template<class H, class T>
class Derived
: public Base< TL<H,T> >
{
public:
void g()
{
Base< TL<H,T> >::f<1>();
}
};
which if I understand the trouble.texi correctly, should also be a legal way
to introduce the dependency, then it still fails to compile with the same
errors as with this->, quoted above, for all versions of gcc 3.2 through 3.4.
Consequently, I am reopening the bug.