Bug 50295 - gcc 2.96 bogus error specializing a template function
gcc 2.96 bogus error specializing a template function
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.1
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-29 21:52 EDT by Martin Sebor
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-15 12:14:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Sebor 2001-07-29 21:52:09 EDT
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.