g++ 2.95.2 bug report

Martin Sebor sebor@roguewave.com
Wed Dec 8 18:49:00 GMT 1999


Hi,

this is a g++ 2.95.2 bug report. The code below doesn't compile.

Thank you
Martin


$ cat test.cpp

template <class T, class U>
struct A { };

template <class T>
struct B
{
    template <class U, class V>
    A<U, V> foo ();
};


template <class T, class U>
void bar (T, U)
{
    B<int> b;
    b.foo <A<T, U> > ();
}


int main ()
{
    bar (1, 'z');
}


$ g++ -v -c test.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/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__ -Di686 -Dpentiumpro -D__i686 -D__i686__
-D__pentiumpro -D__pentiumpro__ test.cpp /tmp/ccSDUKVX.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
 /usr/local/include

/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
 /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/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/i686-pc-linux-gnu/2.95.2/cc1plus /tmp/ccSDUKVX.ii
-quiet -dumpbase test.cc -version -o /tmp/cc40XGaL.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled
by GNU C version 2.95.2 19991024 (release).
test.cpp: In function `void bar(T, U)':
test.cpp:18: parse error before `>'


More information about the Gcc-bugs mailing list