[Bug c++/27209] New: Call to template method of template superclass of template does not parse
jjamison at cs dot berkeley dot edu
gcc-bugzilla@gcc.gnu.org
Wed Apr 19 03:16:00 GMT 2006
[jjamison@manzanita /tmp]$ /usr/misc/pkg/gcc-4.0.2/bin/g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.2/configure --prefix=/usr/misc/pkg/gcc-4.0.2
--enable-shared --enable-threads=posix --with-system-zlib --with-gnu-as
--with-as=/usr/misc/pkg/binutils-2.16/bin/as --with-gnu-ld
--with-ld=/usr/misc/pkg/binutils-2.16/bin/ld --enable-__cxa_atexit
--enable-languages=c,c++
Thread model: posix
gcc version 4.0.2
Compile the following file:
========start of file==========
template<class JT>
struct JIG {
template<class T>
void io() {}
};
template<class TT>
struct TIG : public JIG<TT> {
void m() {
this->io<int>();
JIG<TT>::io<int>();
}
};
========end of file==========
[jjamison@manzanita /tmp]$ /usr/misc/pkg/gcc-4.0.2/bin/g++ foo2.cc
foo2.cc: In member function Âvoid TIG<TT>::m()Â:
foo2.cc:10: error: expected primary-expression before ÂintÂ
foo2.cc:10: error: expected `;' before ÂintÂ
foo2.cc:11: error: expected primary-expression before ÂintÂ
foo2.cc:11: error: expected `;' before ÂintÂ
This shows that an attempt to call io fails to parse. However, both calls
above are valid calls. Making any of the above not a template allows the file
to compile.
This seems to be reproduced in the 3.4 series as well.
--
Summary: Call to template method of template superclass of
template does not parse
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jjamison at cs dot berkeley dot edu
GCC build triplet: i686-linux-gnu
GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27209
More information about the Gcc-bugs
mailing list