This is the mail archive of the gcc-prs@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]

c++/3656: ICE when incorrectly deriving a class from a templated base in another namespace



>Number:         3656
>Category:       c++
>Synopsis:       ICE when incorrectly deriving a class from a templated base in another namespace
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 11 19:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     gjkaiser@intrinsic.com
>Release:        egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>Organization:
>Environment:
i386-redhat-linux
>Description:
Deriving a class from a templated base in another namespace,
but forgetting to instance the template to serve as the
base, generates an ICE.  Workaround is to use an instance of
the template as the base class, as C++ requires.

The given test case, while giving an ICE in the compiler
version listed, compiles without any error with
CodeSourcery's Online Test Compilation.  That is incorrect
as well, as the code is illegal C++.
>How-To-Repeat:
Compile the following:

namespace Space { template <class T> class base { }; }
class child : public Space::base { };
>Fix:
I don't know of a fix, but the fix may be the same as for
Bug 3123, which looks to be similar to this one.  I don't
know the compiler code to know if this report is redundant
with 3123.
>Release-Note:
>Audit-Trail:
>Unformatted:


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