public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug java/46983] New: Diagnostic about change in meaning of name in class misses some cases
Date: Thu, 16 Dec 2010 20:58:00 -0000	[thread overview]
Message-ID: <bug-46983-8172@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46983

           Summary: Diagnostic about change in meaning of name in class
                    misses some cases
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jason@gcc.gnu.org
                CC: jason@gcc.gnu.org, rth@gcc.gnu.org


In C++, it is ill-formed, no diagnostic required, for a lookup to have
different meanings at the point of lookup and in the context of the complete
class.  G++ gives diagnostics about some instances of this, but misses this
one:

template <class T>
struct A
{
  typedef typename T::Y Z;
};

struct B
{
  typedef int Y;
};

struct C: B
{
  struct N: A<C> { };
  typedef char Y;
};

int ar[sizeof(C::N::Z) == sizeof(int) ? 1 : -1];

Here when we instantiate A<C>, C is not yet complete, so when we lookup C::Y we
find B::Y.  If we were to do the lookup in the full class, it would find C::Y
instead.


                 reply	other threads:[~2010-12-16 20:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-46983-8172@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@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).