This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
parse error using gcc 2.95
- To: gcc-bugs at gcc dot gnu dot org
- Subject: parse error using gcc 2.95
- From: Luc dot Maisonobe at cnes dot fr (Luc Maisonobe)
- Date: Wed, 4 Aug 1999 17:38:35 +0200 (MEST)
- Cc: Geraldine dot Filaire at cnes dot fr, Martine dot Julien at cisi dot cnes dot fr
Hello,
I have recently upgraded to gcc 2.95 and encountered a parse
error. Here is a stripped down version of the file that reproduce the
bug (the parse error is in the last line, the one with three layers of
constructors). There is no parse error using either gcc 2.8.1 or egcs 1.1.2.
The error occurs on both Linux and Solaris.
-------------------- x.cc --------------------
template <class T> class A { public : A (T x, T y, T z); };
class B { public : B (const A<double>& a, double x); };
class C { public : C (const B& b); };
void f ()
{ double p = 0.1;
double q = 0.2;
C c (B (A<double> (-p, -p, q), 0.5));
}
-------------------- x.cc --------------------
The output of the compiler is :
(lurien) luc% g++ -c -v x.cc
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95/specs
gcc version 2.95 19990728 (release)
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ x.cc /tmp/cc2KM7X4.ii
GNU CPP version 2.95 19990728 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95/../../../../include/g++-3
/usr/local/include
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95/../../../../i586-pc-linux-gnu/include
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95/cc1plus /tmp/cc2KM7X4.ii -quiet -dumpbase x.cc -version -o /tmp/ccLu4q05.s
GNU C++ version 2.95 19990728 (release) (i586-pc-linux-gnu) compiled by GNU C version 2.95 19990728 (release).
x.cc: In function `void f()':
x.cc:10: parse error before `,'
(lurien) luc%
Luc
--
------------------------------------------------------------------------------
Luc Maisonobe - DTS/MPI/MS/AM | Tel : (33) 05-61-28-26-31
CNES | Fax : (33) 05-61-27-35-40
18 avenue E. Belin |
31401 Toulouse CEDEX 4 - FRANCE | Email: Luc.Maisonobe@cnes.fr
------------------------------------------------------------------------------