This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[BUG] egcs-1.1.1 or later (with testcase)
- To: egcs-bugs at cygnus dot com
- Subject: [BUG] egcs-1.1.1 or later (with testcase)
- From: "Gilles Depeyrot" <Gilles dot Depeyrot at wanadoo dot fr>
- Date: Tue, 09 Feb 1999 19:59:59 +0100
The following code sample (extracted from it's context) gives a
parse error in egcs 1.1.1 and also in one of the latest snapshots.
It compiles fine with SunSoft CC or MicroSoft Visual C++.
The error message is the following (please note that the warning
is also bogus):
foo.cc: In function `void bug()':
foo.cc:19: parse error before `,'
foo.cc: At top level:
foo.cc:13: warning: `long int my_bug(long int)' defined but not used
--- begin foo.cc ---
template <class arg>
class my_template {
public:
my_template(const long in1, const long in2)
{
}
};
class my_arg
{};
static long my_bug(const long in1)
{
return in1;
}
void bug()
{
my_template<my_arg>(my_bug(0L), 1L);
}
--- end foo.cc ---
Compilation with egcs 1.1.1 gives the following result:
--- begin egcs 1.1.1 ---
Reading specs from
/usr/local/GNU/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91
.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
/usr/local/GNU/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91
.60/cpp -
lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__
-D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix
-Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS -Wall -D__GCC_NEW_VARARGS__
-Acpu(sparc) -Amachine(sparc) foo.cc /var/tmp/ccpqXyhL.ii
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/GNU/common/include/g++
/usr/local/GNU/sparc-sun-solaris2/sparc-sun-solaris2.5/include
/usr/local/GNU/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91
.60/inclu
de
/usr/include
End of search list.
/usr/local/GNU/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91
.60/cc1pl
us /var/tmp/ccpqXyhL.ii -quiet -dumpbase foo.cc -Wall -version -o
/var/tmp/ccAiflCs.s
GNU C++ version egcs-2.91.60 19981201 (egcs-1.1.1 release)
(sparc-sun-solaris2.5) compiled by GNU C version egcs-2.91.60 19981201
(egcs-1.1.1 release).
foo.cc: In function `void bug()':
foo.cc:19: parse error before `,'
foo.cc: At top level:
foo.cc:13: warning: `long int my_bug(long int)' defined but not used
--- end egcs 1.1.1 ---
Compilation with egcs snapshot 19990208 gives the following result:
--- begin egcs 19990208 ---
Reading specs from
/mars/cygnus/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.93.06/specs
gcc version egcs-2.93.06 19990208 (gcc2 ss-980929 experimental)
/mars/cygnus/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.93.06/cpp -lang-c++
-v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=93
-Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__
-D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix)
-Asystem(svr4) -D__EXCEPTIONS -Wall -D__GCC_NEW_VARARGS__ -Acpu(sparc)
-Amachine(sparc) foo.cc /var/tmp/ccJqdaaa.ii
GNU CPP version egcs-2.93.06 19990208 (gcc2 ss-980929 experimental) (sparc)
#include "..." search starts here:
#include <...> search starts here:
/mars/cygnus/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.93.06/../../../../inc
lude/g++-
2
/mars/cygnus/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.93.06/../../../../spa
rc-sun-so
laris2.5.1/include
/mars/cygnus/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.93.06/include
/usr/include
End of search list.
/mars/cygnus/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.93.06/cc1plus
/var/tmp/ccJqdaaa.ii -quiet -dumpbase foo.cc -Wall -version -o
/var/tmp/cciHgaaa.s
GNU C++ version egcs-2.93.06 19990208 (gcc2 ss-980929 experimental)
(sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.93.06 19990208
(gcc2 ss-980929 experimental).
foo.cc: In function `void bug()':
foo.cc:19: parse error before `,'
foo.cc: At top level:
foo.cc:13: warning: `long int my_bug(long int)' defined but not used
--- end egcs 19990208 ---