This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 2.95.2: Forward decl., mem. ptrs, and templates
- To: gcc-bugs at gcc dot gnu dot org
- Subject: g++ 2.95.2: Forward decl., mem. ptrs, and templates
- From: Hans Erickson <herickso at stratasys dot com>
- Date: Wed, 03 May 2000 14:51:09 -0500
- Organization: Stratasys, Inc.
Hello,
I've found what I believe to be a bug in the compiler. The following is
my system information:
$ uname -a
Linux lungz 2.2.14 #3 SMP Fri Jan 28 16:16:29 CST 2000 i686 unknown
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
The following line compiles fine.
template<class M, class T> void test(M T::*) {}
However, when I add a forward declaration, I get an error.
$ cat test.cpp
template<class M, class T> void test(M T::*);
template<class M, class T> void test(M T::*) {}
$ g++ -c test.cpp
test.cpp:2: common_type called with uncommon member types (compiler
error)
I'm assuming that this is a compiler error ('cause it says so :), but it
doesn't seem to follow the format of the other internal errors that I've
seen on the list.
Is this fixed in a later version?
Thanks,
- Hans