public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: reichelt@igpm.rwth-aachen.de
To: gcc-gnats@gcc.gnu.org
Subject: c++/10554: ICE with illegal using declaration
Date: Tue, 29 Apr 2003 19:56:00 -0000	[thread overview]
Message-ID: <20030429195524.8303.qmail@sources.redhat.com> (raw)


>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:


             reply	other threads:[~2003-04-29 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-29 19:56 reichelt [this message]
2003-04-29 19:59 bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030429195524.8303.qmail@sources.redhat.com \
    --to=reichelt@igpm.rwth-aachen.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).