From patchwork Tue May 15 12:04:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 913582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-477699-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Pd/yd4+T"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40lbpD1ynXz9ryk for ; Tue, 15 May 2018 22:04:18 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=yZo+LAFtLuhq6bBNPTFh03PmotTt+upxz2zEB8WNoFhHFnE5ysGvm aKcb0QcmcQqxcf1ZoSKIKeMdH0sR8D90vdOCHtsszMBL6f4PPAPVFE57RKl3U4t3 Q0nj+Ikm74S3jWmwhn9QU8aLkjsWnAOBcnipHcA2O+3hJCAbmKLOm0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=zCzFhpLCqNTtT+aMNNZxjLVXYYA=; b=Pd/yd4+TvKyfXupfGXO+ AYLESw7mGLNTilxHLJiVOLoR8u2XyFTX5WNyglQoVFFyLtPo/9dTzAznER4Tcv3N 9/dR+ObMDcjy0xUvIGQIa2TTwwtvYvlBA/NaVX+NzE/FUiXfwEy4JdmC2Z1n938t XPtMjthMqBAc+9A0A27h9J4= Received: (qmail 8529 invoked by alias); 15 May 2018 12:04:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 8378 invoked by uid 89); 15 May 2018 12:04:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 May 2018 12:04:05 +0000 Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44675C7F16; Tue, 15 May 2018 12:04:04 +0000 (UTC) Received: from localhost (unknown [10.33.36.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id B85D030BE00B; Tue, 15 May 2018 12:04:03 +0000 (UTC) Date: Tue, 15 May 2018 13:04:02 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Qualify std::__invoke in to prevent ADL Message-ID: <20180515120402.GA26806@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.2 (2017-12-15) Calling unqualified __invoke can't find the wrong function, because users can't use that name in their own namespaces, but qualifying it should make name lookup slightly faster. * include/std/variant (__gen_vtable_impl::__visit_invoke): Qualify __invoke to prevent ADL. Tested powerpc64le-linux, committed to trunk. commit c2f226ebd16d0f2f6cba92cd87f55282697bbd3a Author: Jonathan Wakely Date: Tue May 15 01:05:39 2018 +0100 Qualify std::__invoke in to prevent ADL * include/std/variant (__gen_vtable_impl::__visit_invoke): Qualify __invoke to prevent ADL. diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 40b3b566938..c0212404bb2 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -838,9 +838,8 @@ namespace __variant decltype(auto) static constexpr __visit_invoke(_Visitor&& __visitor, _Variants... __vars) { - return __invoke(std::forward<_Visitor>(__visitor), - std::get<__indices>( - std::forward<_Variants>(__vars))...); + return std::__invoke(std::forward<_Visitor>(__visitor), + std::get<__indices>(std::forward<_Variants>(__vars))...); } static constexpr auto