public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, martind@bluearc.com,
	nobody@gcc.gnu.org
Subject: Re: c++/5338: -pedantic reports ambiguous base
Date: Wed, 09 Jan 2002 22:48:00 -0000	[thread overview]
Message-ID: <20020110064838.13870.qmail@sources.redhat.com> (raw)

Synopsis: -pedantic reports ambiguous base

State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Wed Jan  9 22:48:37 2002
State-Changed-Why:
    Information submitted by martin@v.loewis.de
    
    > Without -pedantic there is not even a warning (even with -W -Wall).
    
    > 10.2.1 says "for a qualified-id, name lookup begins in the scope of
    > 10.2.the nested-name-specifier".  In which scope, I don't think the
    > 10.2.reference to pop() or HWQueue, for that matter, is ambiguous.
    
    This is caused by the fragment in cp/init.c
    
       /* Convert 'this' to the specified type to disambiguate conversion
          to the function's context.  Apparently Standard C++ says that we
          shouldn't do this.  */
       if (decl == current_class_ref
           && ! pedantic
           && ACCESSIBLY_UNIQUELY_DERIVED_P (type, current_class_type))
    
    It seems there are several interpretations of 10.2/1. GCC's
    interpretation is that, indeed, lookup starts in ISPmq, and finds
    HwQueue::pop. So the call you have written is equivalent to
    
       this->HwQueue::pop();
    
    which is ambiguous.
    
    It would be good if you could achieve independent clarification,
    e.g. through comp.std.c++. If people are of different opinion there as
    well, consider filing a Defect Report. Notice that variations of this
    have been discussed repeatedly in comp.stdc.c++; you may want to read
    the archives.
    
    Regards,
    Martin

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5338


             reply	other threads:[~2002-01-10  6:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-09 22:48 rodrigc [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-25 16:03 bangerth
2002-01-23 21:16 Craig Rodrigues
2002-01-09 13:26 Martin Dorey

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=20020110064838.13870.qmail@sources.redhat.com \
    --to=rodrigc@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=martind@bluearc.com \
    --cc=nobody@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).