Bug 50295 - gcc 2.96 bogus error specializing a template function
Summary: gcc 2.96 bogus error specializing a template function
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.1
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-30 01:52 UTC by Martin Sebor
Modified: 2007-04-18 16:35 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2002-12-15 17:14:02 UTC


Attachments (Terms of Use)

Description Martin Sebor 2001-07-30 01:52:09 UTC
This (legal code) fails to compile with gcc 2.96; 2.95.2 has no trouble.

$ cat t.cpp ; gcc -v t.cpp
template <class T>
struct A { typedef int I; };

template <class T>
inline typename T::I
foo (typename T::I, const T*);

template <>
int foo (int i, const A<long>*)
{
    return i + 1;
}
Reading specs from /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
 /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/cpp0 -lang-c++ -D__GNUG__=2 -D__EXCEPTIONS -v -iprefix 
/package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/ -D__GNUC__=2 -D__GNUC_MINOR__=96 
-D__GNUC_PATCHLEVEL__=0 -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix -D__LP64__ -D__ELF__ 
-D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -D__linux__ -D__unix__ -D__LP64__ -D__ELF__ -D__linux -D__unix 
-Asystem(linux) -Acpu(ia64) -Amachine(ia64) -D__NO_INLINE__ -D__LONG_MAX__=9223372036854775807L t.cpp /tmp/cc04HAxF.ii
GNU CPP version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (cpplib) (IA-64)
#include "..." search starts here:
#include <...> search starts here:
 /package/1/ia64/compilers/gcc-2.96-85/include/g++-3
 /package/1/ia64/compilers/gcc-2.96-85/lib/gcc-lib/ia64-redhat-linux/2.96/include
 /package/1/ia64/compilers/gcc-2.96-85/ia64-redhat-linux/include
 /usr/package/1/compilers/gcc-2.96-85-ia64/include/g++-3
 /usr/package/1/compilers/gcc-2.96-85-ia64/include
 /usr/package/1/compilers/gcc-2.96-85-ia64/lib/gcc-lib/ia64-redhat-linux/2.96/include
 /usr/package/1/compilers/gcc-2.96-85-ia64/ia64-redhat-linux/include
 /usr/include
End of search list.
 /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/cc1plus /tmp/cc04HAxF.ii -mb-step -quiet -dumpbase t.cpp 
-version -o /tmp/ccwlcvla.s
GNU C++ version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (ia64-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 
7.1 2.96-85).
t.cpp: In function `typename T::I foo (typename T::I, const T *) [with 
T = A<long int>]':
t.cpp:11: `i' undeclared (first use this function)
t.cpp:11: (Each undeclared identifier is reported only once for each 
function it appears in.)


Note You need to log in before you can comment on or make changes to this bug.