Bugs in 1.0.3 not in previous snapshots
Niall Smart
njs3@doc.ic.ac.uk
Thu May 21 15:29:00 GMT 1998
[ Apologies if you get this message twice, my mailing software
confused me today :) ]
Hi,
I have found three, possibly related bugs in egcs 1.0.3-release that
were not in egcs-2.91.08 980214. These bugs may be in all 1.0.x.
Bug #1:
The following code compiles, it should not; there are more template
arguments supplied to the function foo than permitted in main:
1 template<class A>
2 void foo(void)
3 {
4 return;
5 }
6
7 int main()
8 {
9 foo<int, int, 2>();
10 }
Bug #2:
The following code does not compile, compilation fails on the lines
explicitly instantiating the template function foo:
1 template<class A>
2 A foo(void)
3 {
4 A a;
5
6 return a;
7 }
8
9 template
10 int foo<int>(void);
11
12 int main()
13 {
14 return 0;
15 }
bug2.cc:10: incomplete type unification
bug2.cc:10: no matching template for `foo()' found
Bug #3:
The following code does not compile, compilation fails with
an internal compiler error:
1 #include <iostream>
2
3 template<class A, void (*B)(const A&)>
4 void
5 foo(const A& a)
6 {
7 B(a);
8 }
9
10 void
11 bar(const int& i)
12 {
13 cerr << i << endl;
14 }
15
16 int main()
17 {
18 foo<int, bar>(34);
19 }
bug3.cc: In function `int main()':
bug3.cc:18: Internal compiler error.
bug3.cc:18: Please submit a full bug report to `egcs-bugs@cygnus.com'.
As I mentioned, all the above code compiles and works perfectly on:
[njs3@cnet0000 ~]$ g++ -v
Reading specs from
/homes/njs3/pub/egcs/980214/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.08/specs
gcc version egcs-2.91.08 980214 (gcc-2.8.0 release)
but not:
[njs3@cnet0000 ~]$ g++ -v
Reading specs from
/homes/njs3/pub/egcs/1.0.3/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
I can supply more information if necessary. If someone fixes this
I'd appreciate if they could drop me a note.
Regards,
Niall
More information about the Gcc-bugs
mailing list