public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/46983] New: Diagnostic about change in meaning of name in class misses some cases
@ 2010-12-16 20:58 jason at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: jason at gcc dot gnu.org @ 2010-12-16 20:58 UTC (permalink / raw)
  To: java-prs

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-16 20:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-16 20:58 [Bug java/46983] New: Diagnostic about change in meaning of name in class misses some cases jason at gcc dot gnu.org

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).