From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Krivosheev To: egcs-bugs@cygnus.com Subject: bug report Date: Sun, 07 Sep 1997 08:41:00 -0000 Message-id: X-SW-Source: 1997-09/msg00085.html List-Id: Hi, next code fragment gives me internal compiler error on linux but syntax errors on sun. 1. stas:~/BETA $ uname -a Linux stas 2.0.30 #1 Sun Jun 1 09:14:11 EST 1997 i586 unknown stas:~/BETA $ c++ -v Reading specs from /home/kriol/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.90.05/specs gcc version egcs-2.90.05 970904 (gcc2-970802 experimental) this is Pentium box with Debian unstable (glibc 2.0.4) ICR here 2. drabble /scratch/BETA$ uname -a SunOS drabble 5.5.1 Generic_103640-08 sun4m sparc SUNW,SPARCstation-4 drabble /scratch/BETA$ c++ -v Reading specs from /home/room1/kriol/local/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.90.05/specs gcc version egcs-2.90.05 970904 (gcc2-970802 experimental) syntax error: drabble /scratch/BETA$ c++ -c porder.cpp porder.cpp: In function `int main()': porder.cpp:28: no match for call to `(A) (I<0> &, I<1> &)' porder.cpp:19: candidates are: template template A::operator ()(I, I) porder.cpp:15: template template A::operator ()(T1, T2) porder.cpp:32: no match for call to `(A) (float, double)' porder.cpp:19: candidates are: template template A::operator ()(I, I) porder.cpp:15: template template A::operator ()(T1, T2) regards OK -------------------------------------------------------------------- template struct I { }; template struct A { int r; template void operator()(T1, T2) { r = 0; } template void operator()(I, I) { r = 1; } }; int main() { A x; I<0> a; I<1> b; x(a,b); if (x.r != 1) return 1; x(float(), double()); if (x.r != 0) return 1; return 0; }