From patchwork Fri Jul 6 13:55:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 169475 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7C84A2C0203 for ; Fri, 6 Jul 2012 23:58:41 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1342187921; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=hubEVQkvuOGvNy7spC0kLwjdH1g=; b=L2GYdIZjbphDIic TcDtFVJQwGySwhO2k3L3iIDsdOYieVboqIpAeEN8QteQoB9nfypUmNYjs4CTTDOq FlPw58cS0ylc9OJ/BMD+dJkssdwPfsh1770HeRN6gv2KALknTAniq7tJVH7PEK5E WLkLIcwVnt/fI1fBwyZfilgxIzOo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=WB22xTx0Dcy6t4FDw6rBcAAkonGIUtaUzvKVItHfKaQsu59h1iFWAaQtP0zn3X vkCE9briZnmuIlkGGvEJZe1TcFAyH3I7ZJQId0JOz3zeQ6Y03Ncs40v1qnmKkkGM wUES2yPLmY745/gxyIWHqD09KR0ug3GvrIlFoiLrYFkMM=; Received: (qmail 32060 invoked by alias); 6 Jul 2012 13:58:35 -0000 Received: (qmail 32045 invoked by uid 22791); 6 Jul 2012 13:58:33 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Jul 2012 13:58:05 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q66Dw3jj003825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Jul 2012 13:58:03 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q66Dw2wR009558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Jul 2012 13:58:03 GMT Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q66Dw2tN019456; Fri, 6 Jul 2012 08:58:02 -0500 Received: from [192.168.1.4] (/79.33.223.37) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 06 Jul 2012 06:58:02 -0700 Message-ID: <4FF6EE57.70608@oracle.com> Date: Fri, 06 Jul 2012 15:55:35 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] libstdc++/53872 X-IsSubscribed: yes 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 Hi, tested x86_64-linux, committed mainline and 4_7-branch. Thanks, Paolo. //////////////////// 2012-07-06 Paolo Carlini PR libstdc++/53872 * include/std/thread (thread::_M_make_routine): Qualify make_shared to prevent ADL. * testsuite/30_threads/thread/adl.cc: New. Index: include/std/thread =================================================================== --- include/std/thread (revision 189314) +++ include/std/thread (working copy) @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -188,7 +188,7 @@ _M_make_routine(_Callable&& __f) { // Create and allocate full data structure, not base. - return make_shared<_Impl<_Callable>>(std::forward<_Callable>(__f)); + return std::make_shared<_Impl<_Callable>>(std::forward<_Callable>(__f)); } }; Index: testsuite/30_threads/thread/adl.cc =================================================================== --- testsuite/30_threads/thread/adl.cc (revision 0) +++ testsuite/30_threads/thread/adl.cc (revision 0) @@ -0,0 +1,37 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +template +void make_shared(P&&...) +{} + +struct C {}; + +void f(C){} + +// PR libstdc++/53872 +int main() +{ + std::thread t(std::bind(&::f, C())); +}