template problem in gcc with --pedantic-errors

Joe Lindström joeli@ida.liu.se
Thu Nov 15 08:05:00 GMT 2001


Hello,

I get an odd parse error when compiling some template code with the 
--pedantic-errors switch. Without this switch it compiles without 
errors. I have tried this with both gcc 2.96 and 3.0.1. It compiles 
without errors in Visual C++.

Here is my command line and gcc's output (source code and preprocessed 
file attached):

astmatix <28> gcc -v -save-temps --pedantic-errors fultest.cpp -o fultest
Reading specs from 
/sw/gcc-3.0.1/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/specs
Configured with: ../gcc-3.0.1/configure --prefix=/sw/gcc-3.0.1 
--enable-shared --enable-cpp
Thread model: posix
gcc version 3.0.1
  /sw/gcc-3.0.1/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/cpp0 -lang-c++ 
-D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 
-v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -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__NO_INLINE__ -D__STDC_HOSTED__=1 
-pedantic-errors -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 
-D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__GCC_NEW_VARARGS__ 
-Acpu=sparc -Amachine=sparc fultest.cpp fultest.ii
GNU CPP version 3.0.1 (cpplib) (sparc)
ignoring nonexistent directory "/sw/gcc-3.0.1/sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
  /sw/gcc-3.0.1/include/g++-v3
  /sw/gcc-3.0.1/include/g++-v3/sparc-sun-solaris2.8
  /sw/gcc-3.0.1/include/g++-v3/backward
  /usr/local/include
  /sw/gcc-3.0.1/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/include
  /usr/include
End of search list.
  /sw/gcc-3.0.1/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/cc1plus 
-fpreprocessed fultest.ii -quiet -dumpbase fultest.cpp -pedantic-errors 
-version -o fultest.s
GNU CPP version 3.0.1 (cpplib) (sparc)
GNU C++ version 3.0.1 (sparc-sun-solaris2.8)
         compiled by GNU C version 3.0.1.
fultest.cpp: In constructor `Foo<T>::Foo()':
fultest.cpp:6: parse error before `;' token

Regards, Joe Lindström
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fultest.ii.gz
Type: application/gzip
Size: 80724 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20011115/bb773f75/attachment.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fultest.cpp
Type: text/cpp
Size: 158 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20011115/bb773f75/attachment.bin>


More information about the Gcc-bugs mailing list