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]

Bug in gcc-2.95.2


Dear gcc-developers, 
the current gcc stops with an error on the following code.  I assume this
is a bug, since moving the declaration "A a;" from inside function g to the
global scope, the code compiles. Surprisingly, the code also compiles, if i
rename function g to f.


Preprocessed output of sample code "l.C":
-----------------------------------------
# 1 "l.C"
struct A {
  template <int I> void f() {}
};

template <int J>
void g() {
  A a;
  a.f<1>();
}

int main() {
}

0 [324] >uname -a && $x57/gcc-2.95.2/bin/g++ -v
SunOS bridge 5.7 Generic_106541-05 sun4u sparc
Reading specs from /afs/informatik.uni-tuebingen.de/sun4x_57/gcc-2.95.2/lib/gcc
-lib/sparc-sun-solaris2.7/2.96/specs
gcc version 2.96 19991110 (experimental)
0 [325] >$x57/gcc-2.95.2/bin/g++ l.C -o l
l.C: In function `void g<J> ()':
l.C:8: parse error before `)'


Regards,
----------------------------------------------------------------------
Marcus Ritt
Universität Tübingen, Technische Informatik
Sand 13, 72070 Tübingen

Email: ritt@informatik.uni-tuebingen.de		Tel. +49 7071 29-75865
						Fax. +49 7071 29-5062
----------------------------------------------------------------------




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