public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>,
	Benjamin Kosnik <bkoz@redhat.com>,
		"libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: RFA (libstdc++): C++/v3 PATCH for c++/24163 (lookup in dependent bases) and c++/29131
Date: Fri, 20 May 2011 19:46:00 -0000	[thread overview]
Message-ID: <BANLkTikt25ZT092x-zPkxJrJqvAGeHwSgg@mail.gmail.com> (raw)
In-Reply-To: <4DD69790.8070101@redhat.com>

On Fri, May 20, 2011 at 11:32 AM, Jason Merrill <jason@redhat.com> wrote:
> G++ has had a long-standing bug with unqualified name resolution in
> templates: if we didn't find any declaration when looking up a name in the
> template definition, we would do an additional unqualified lookup at the
> point of instantiation.  This led to incorrectly finding namespace-scope
> functions declared later (29131) and member functions of dependent bases
> (24163).  This patch fixes that bug.

Ah, I had always assumed that the previous implementation was exploiting
a license given by the standard which says that both contexts should
yield the same resolution, otherwise the program was ill-formed, no diagnostic
required.

>
> To be friendly to users, the patch also allows affected code to compile with
> -fpermissive and provides suggestions about how to fix the code: either
> declaring the desired function earlier (29131) or explicitly qualifying the
> name with this-> or Class:: (24163).
>
> This caused a lot of regressions in the libstdc++ testsuite, which I've
> fixed.  To find names in dependent bases, I've added explicit this-> in
> non-static member functions, and explicit Class:: in static member
> functions.  I'd like confirmation from the library folks that this is the
> style they want to use for this.
>
> There were also a couple of issues with calls to functions that hadn't been
> declared yet; library folks should definitely check my formatting on the
> forward declarations I've added, for mem_fn in functional and for
> __expint_E1 in exp_integral.tcc.
>
> Tested x86_64-pc-linux-gnu.  Are the library changes OK for trunk?
>

OK.

-- Gaby

  parent reply	other threads:[~2011-05-20 17:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 17:09 Jason Merrill
2011-05-20 18:26 ` Paolo Carlini
2011-05-20 19:46 ` Gabriel Dos Reis [this message]
2011-05-20 20:39   ` Jason Merrill
2011-05-20 21:56     ` Gabriel Dos Reis
2011-05-21  0:32 ` Joe Buck
2011-05-21  3:01   ` Christopher Jefferson
2011-05-21  3:44     ` Jason Merrill
2011-05-24  9:41 ` Jason Merrill
2011-05-24 11:50   ` Paolo Carlini
2011-05-24 18:51     ` Jason Merrill
2011-05-27 10:30 ` Jonathan Wakely
2011-05-27 12:26   ` Paolo Carlini
2011-05-27 12:34     ` Paolo Carlini
2011-05-28  1:08   ` Jonathan Wakely

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=BANLkTikt25ZT092x-zPkxJrJqvAGeHwSgg@mail.gmail.com \
    --to=gdr@integrable-solutions.net \
    --cc=bkoz@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=libstdc++@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).