From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17056 invoked by alias); 28 Nov 2010 02:48:15 -0000 Received: (qmail 17046 invoked by uid 22791); 28 Nov 2010 02:48:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,TW_NW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from csmailer.cs.nctu.edu.tw (HELO csmailer.cs.nctu.edu.tw) (140.113.235.130) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 28 Nov 2010 02:48:09 +0000 Received: from csmailer.cs.nctu.edu.tw (localhost [127.0.0.1]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id A172F67E for ; Sun, 28 Nov 2010 10:51:00 +0800 (CST) Received: from alumni.cs.nctu.edu.tw (alumni.cs.nctu.edu.tw [140.113.235.116]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 6870167D for ; Sun, 28 Nov 2010 10:51:00 +0800 (CST) Received: (from chenwj@localhost) by alumni.cs.nctu.edu.tw (8.14.4/8.14.4/Submit) id oAS2m6XP052664 for gcc-help@gcc.gnu.org; Sun, 28 Nov 2010 10:48:06 +0800 (CST) (envelope-from chenwj) Date: Sun, 28 Nov 2010 03:38:00 -0000 From: =?utf-8?B?6Zmz6Z+L5Lu7?= To: gcc-help@gcc.gnu.org Subject: Fail to compile Boost make_shared when -std=c++0x on Message-ID: <20101128024806.GB36048@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-11/txt/msg00296.txt.bz2 Hi, I don't know this is a bug or not. Here is the example code: // test.cpp #include #include #include int main() { using namespace boost; shared_ptr > x =3D make_shared >(10); } I use g++45 and g++46 installed from ports on FreeBSD. Everything is fine when I compile the code without any option. However, when I turn the option "-std=3Dc++0x" on, g++ give me the error messge below: In file included from /usr/local/include/boost/make_shared.hpp:15:0, from test.cpp:2: /usr/local/include/boost/smart_ptr/make_shared.hpp: In function 'boost::shared_ptr boost::make_shared(Args&& ...) [with T =3D std::vector, Args =3D int]': test.cpp:9:38: instantiated from here /usr/local/include/boost/smart_ptr/make_shared.hpp:148:5: error: no matching function for call to 'forward(int&)' /usr/local/include/boost/smart_ptr/make_shared.hpp:90:40: note: candidate is: template T&& boost::detail::forward(T&&) And here are gcc versions: g++46 (GCC) 4.6.0 20101023 (experimental) g++45 (GCC) 4.5.2 20101021 (prerelease) Any suggestion appreciated. Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Tel:886-2-2788-3799 #1667 Parallel Processing Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.)