c++/10554: ICE with illegal using declaration
reichelt@igpm.rwth-aachen.de
reichelt@igpm.rwth-aachen.de
Tue Apr 29 20:18:00 GMT 2003
>Number: 10554
>Category: c++
>Synopsis: ICE with illegal using declaration
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Tue Apr 29 19:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Volker Reichelt
>Release: gcc 3.4-20030402
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
Consider the following code snippet:
-------------------------------snip here------------------------
template <typename> struct A
{
typedef A X;
void foo();
};
template <typename T> struct B : A<T>
{
using X::foo;
};
-------------------------------snip here------------------------
X is declared in template class A and there's a using declaration in a
derived class that uses X. The using declaration is illegal, it should
of course read "using A<T>::X::foo;".
Alternatively one could add a "using typename A<T>::X;" before (which
presently does not work due to PR 9447).
Due to incorrect name lookup the above code compiles with gcc 3.2.x and
3.3 branch. With mainline we get an ICE:
PR8582C.cc:9: error: `X' is not a class-name or namespace-name
PR8582C.cc:9: error: expected nested-name-specifier
PR8582C.cc:9: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
So we have an ice-on-illegal-code (error recovery problem) on mainline
which is not a regression. The situation is actually an improvement
on mainline, because we had an accepts-illegal before and now we only have
an error recovery problem. But it's still a bug.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list