From owner-svn-src-stable@FreeBSD.ORG Sun Dec 2 00:31:23 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D430B785; Sun, 2 Dec 2012 00:31:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C7178FC08; Sun, 2 Dec 2012 00:31:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB20VNBq031792; Sun, 2 Dec 2012 00:31:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB20VNrG031791; Sun, 2 Dec 2012 00:31:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201212020031.qB20VNrG031791@svn.freebsd.org> From: Dimitry Andric Date: Sun, 2 Dec 2012 00:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243781 - stable/9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2012 00:31:23 -0000 Author: dim Date: Sun Dec 2 00:31:23 2012 New Revision: 243781 URL: http://svnweb.freebsd.org/changeset/base/243781 Log: Pull in r158245 from upstream clang: [C++11 Compat] Fix breaking change in C++11 pair copyctor. While this code is valid C++98, it is not valid C++11. The problem can be reduced to: class MDNode; class DIType { operator MDNode*() const {return 0;} }; class WeakVH { WeakVH(MDNode*) {} }; int main() { DIType di; std::pair p(std::make_pair((void*)0, di))); } This was not detected by any of the bots we have because they either compile C++98 with libstdc++ (which allows it), or C++11 with libc++ (which incorrectly allows it). I ran into the problem when compiling with VS 2012 RC. Thanks to Richard for explaining the issue. This fixes building clang 3.1 on stable/9 with libc++ in C++11 mode. This is a direct commit to stable/9, since there is no separate commit in head which has just this particular change, and I do not want to do a full import at this time. Reported by: Marco Bröder Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Sat Dec 1 22:13:38 2012 (r243780) +++ stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Sun Dec 2 00:31:23 2012 (r243781) @@ -1692,7 +1692,8 @@ llvm::DIType CGDebugInfo::getOrCreateTyp llvm::DIType TC = getTypeOrNull(Ty); if (TC.Verify() && TC.isForwardDecl()) - ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), TC)); + ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), + static_cast(TC))); // And update the type cache. TypeCache[Ty.getAsOpaquePtr()] = Res; @@ -1803,7 +1804,8 @@ llvm::DIType CGDebugInfo::getOrCreateLim llvm::DIType Res = CreateLimitedTypeNode(Ty, Unit); if (T.Verify() && T.isForwardDecl()) - ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), T)); + ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), + static_cast(T))); // And update the type cache. TypeCache[Ty.getAsOpaquePtr()] = Res;