Bug 50358
| Summary: | gcc 2.96 error referencing a variable in its initializer expression in template code | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | Martin Sebor <sebor> |
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | David Lawrence <dkl> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.1 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | ia64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2002-12-15 17:14:52 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
This fails with 2.96/IA64 as well as 3.0/i86. Regards Martin $ cat t.cpp ; gcc -v t.cpp template <class T> int foo (const T&) { int i = foo (i); return i; } int main () { foo (0); } 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/ccswYVDP.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/ccswYVDP.ii -mb-step -quiet -dumpbase t.cpp -version -o /tmp/ccMxbeRw.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 `int foo (const T &) [with T = int]': t.cpp:10: instantiated from here t.cpp:4: `i' undeclared (first use this function) t.cpp:4: (Each undeclared identifier is reported only once for each function it appears in.)