public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95074] Function found via ADL when it should not Date: Tue, 12 May 2020 20:26:48 +0000 [thread overview] Message-ID: <bug-95074-4-CrFoxzO8Mx@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-95074-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95074 --- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:90b160f8ec515f54ddc36519a6aaa60abdabdec1 commit r11-336-g90b160f8ec515f54ddc36519a6aaa60abdabdec1 Author: Marek Polacek <polacek@redhat.com> Date: Tue May 12 14:56:13 2020 -0400 c++: Function found via ADL when it should not [PR95074] I noticed that we don't implement [basic.lookup.argdep]/3: quite correctly; it says "If X (the lookup set produced by unqualified lookup) contains -- a block-scope function declaration that is not a using-declaration [...] then Y (the lookup set produced by ADL) is empty." but we were still performing ADL in fn1 in the attached test. The problem was that we were only looking at the first function in the overload set which in this case happened to be a using-declaration, and those don't suppress ADL. We have to look through the whole set to find out if unqualified lookup found a block-scope function declaration, or a member function declaration. PR c++/95074 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When looking for a block-scope function declaration, look through the whole set, not just the first function in the overload set. * g++.dg/lookup/koenig15.C: New test.
next prev parent reply other threads:[~2020-05-12 20:26 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-12 5:17 [Bug c++/95074] New: " mpolacek at gcc dot gnu.org 2020-05-12 5:18 ` [Bug c++/95074] " mpolacek at gcc dot gnu.org 2020-05-12 5:31 ` mpolacek at gcc dot gnu.org 2020-05-12 8:50 ` redi at gcc dot gnu.org 2020-05-12 15:00 ` mpolacek at gcc dot gnu.org 2020-05-12 20:26 ` cvs-commit at gcc dot gnu.org [this message] 2020-05-12 20:27 ` mpolacek at gcc dot gnu.org 2021-12-03 0:54 ` pinskia at gcc dot gnu.org
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-95074-4-CrFoxzO8Mx@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).