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]
Other format: [Raw text]

Possible g++ compilation problem.


  $ uname -a
  Linux hope 2.4.22-openmosix3 #1 Wed Apr 14 04:36:24 CEST 2004 i686 i686 i386
  GNU/Linux

  $ g++ -v
  Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs
  Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
  --infodir=/usr/share/info --enable-shared --enable-threads=posix
  --disable-checking --disable-libunwind-exceptions --with-system-zlib
  --enable-__cxa_atexit --host=i386-redhat-linux 
  Thread model: posix
  gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)

  $ cat junk.cc
  struct ast_node {
    template < typename T >
    T get_child() {
      return 0;
      }
    };

  template < typename T >
  void f(T x, ast_node n) {
    n.get_child<int>();
    }

  $ g++ -c junk.cc
  junk.cc: In function `void f(T, ast_node)':
  junk.cc:10: error: syntax error before `>' token

  $ 

and also

  $ uname -a
  SunOS clayton 5.9 Generic_112233-06 sun4u sparc

  $ g++ -v
  Reading specs from
  /usr/local2/bin/../lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/specs 
  Configured with: ./configure --prefix=/usr/local2/stow/gcc-3.3.2
  Thread model: posix
  gcc version 3.3.2

  $ g++ -c junk.cc
  junk.cc: In function `void f(T, ast_node)':
  junk.cc:10: error: parse error before `>' token

  $ 

The Forte and Comeau C++ compilers compile this code without errors.

Attachment: junk.cc
Description: Binary data


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