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]

g++ 2.95.2: Forward decl., mem. ptrs, and templates


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



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