From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A19263851C07; Tue, 12 May 2020 05:31:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A19263851C07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589261481; bh=ylF4+TU9Hoq/GLmo+aW+y3LQnuAf3HxuDI8njHIUG/E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kqVNihNURZ9TRO15R4RGaz5YJVjl6nHjSV1D/gyHsCdZXlDF008az6wEjXmVIJTQQ cPi5RjaiYa9Ak2/EL4Z8fzAvjSHNxtaLSMhQj6OAos7HtT4Z5v/KG6+vjXfoTU81ww LdSxmw2r+g7qEDlW7oDVE3fs8CeZLTOoQex6kgtY= From: "mpolacek at gcc dot 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 05:31:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 05:31:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95074 --- Comment #2 from Marek Polacek --- This is where we're confused by the function introduced by M::f: /* We do not perform argument-dependent lookup if normal lookup finds a non-function, in accordance with the expected resolution of DR 218. */ else if (!args->is_empty () && is_overloaded_fn (postfix_expression)) { /* We only need to look at the first function, because all the fns share the attribute we're concerned with (all member fns or all local fns). */ tree fn =3D get_first_fn (postfix_expression); fn =3D STRIP_TEMPLATE (fn);=20 /* Do not do argument dependent lookup if regular lookup finds a member function or a block-scope function declaration. [basic.lookup.argdep]/3 */ if (!((TREE_CODE (fn) =3D=3D USING_DECL && DECL_DEPENDE= NT_P (fn))=20 || DECL_FUNCTION_MEMBER_P (fn) || DECL_LOCAL_FUNCTION_P (fn))) { koenig_p =3D true;=20 if (!any_type_dependent_arguments_p (args)) postfix_expression =3D perform_koenig_lookup (postfix_expression, = args,=20 complain); } }=