diff options
Diffstat (limited to 'extra/llvm')
-rw-r--r-- | extra/llvm/PKGBUILD | 13 | ||||
-rw-r--r-- | extra/llvm/clang-3.1-fix-lwg-2141.patch | 65 |
2 files changed, 74 insertions, 4 deletions
diff --git a/extra/llvm/PKGBUILD b/extra/llvm/PKGBUILD index f7bf7799c..271602b72 100644 --- a/extra/llvm/PKGBUILD +++ b/extra/llvm/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 169336 2012-10-19 21:28:16Z foutrelis $ +# $Id: PKGBUILD 171485 2012-11-18 02:09:02Z foutrelis $ # Maintainer: Evangelos Foutras <evangelos@foutrelis.com> # Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com> # Contributor: Sebastian Nowicki <sebnow@gmail.com> @@ -11,7 +11,7 @@ pkgname=('llvm' 'llvm-ocaml' 'clang' 'clang-analyzer') pkgver=3.1 -pkgrel=5 +pkgrel=6 arch=('i686' 'x86_64') url="http://llvm.org/" license=('custom:University of Illinois/NCSA Open Source License') @@ -25,7 +25,8 @@ source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.src.tar.gz clang-pure64.patch enable-lto.patch llvm-3.1-fix-debug-line-info.patch - clang-3.1-fix-libprofile_rt.a-location.patch) + clang-3.1-fix-libprofile_rt.a-location.patch + clang-3.1-fix-lwg-2141.patch) sha256sums=('1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab' 'ff63e215dcd3e2838ffdea38502f8d35bab17e487f3c3799579961e452d5a786' '563d8a5ef86123ed8775e115ad7f90c1aa3e80f70b4e587f1bccab2c10753558' @@ -35,7 +36,8 @@ sha256sums=('1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab' '288a82fbff17bc554f5863734246500e637882af33ee8511019d5e0d6cd20524' 'f7145e203ffb4ce2c01976027f7840a9520e5341a9945f2459b6b11e5422d5b7' 'db1f1aadebbc4c4232bdad49fb9b7dc61eac727085c63154b870fa9ce64fd18d' - '0d32ad283566357ca1bfbeb4cbe6b0b961943b79d3d718ed0435101c05629137') + '0d32ad283566357ca1bfbeb4cbe6b0b961943b79d3d718ed0435101c05629137' + 'a3ac405a983643c9cb9081692a3f4d28e5d19571fa12b0517fb2b1f2acab0ad0') build() { cd "$srcdir/$pkgname-$pkgver.src" @@ -81,6 +83,9 @@ build() { patch -d tools/clang -Np1 -i \ "$srcdir/clang-3.1-fix-libprofile_rt.a-location.patch" + # Fix FS#32731: [clang] 3.1 fails to compile libstdc++ <chrono> 4.7.2 + patch -d tools/clang -Np0 -i "$srcdir/clang-3.1-fix-lwg-2141.patch" + # Fix FS#31098: LLVM 3.1 produces invalid debug information # http://llvm.org/bugs/show_bug.cgi?id=13211 patch -Np1 -i "$srcdir/llvm-3.1-fix-debug-line-info.patch" diff --git a/extra/llvm/clang-3.1-fix-lwg-2141.patch b/extra/llvm/clang-3.1-fix-lwg-2141.patch new file mode 100644 index 000000000..af10a5c33 --- /dev/null +++ b/extra/llvm/clang-3.1-fix-lwg-2141.patch @@ -0,0 +1,65 @@ +Index: test/SemaCXX/libstdcxx_common_type_hack.cpp +=================================================================== +--- test/SemaCXX/libstdcxx_common_type_hack.cpp (revision 0) ++++ test/SemaCXX/libstdcxx_common_type_hack.cpp (revision 166455) +@@ -0,0 +1,33 @@ ++// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 -verify ++ ++// This is a test for an egregious hack in Clang that works around ++// an issue with GCC's <type_traits> implementation. std::common_type ++// relies on pre-standard rules for decltype(), in which it doesn't ++// produce reference types so frequently. ++ ++#ifdef BE_THE_HEADER ++ ++#pragma GCC system_header ++namespace std { ++ template<typename T> T &&declval(); ++ ++ template<typename...Ts> struct common_type {}; ++ template<typename A, typename B> struct common_type<A, B> { ++ // Under the rules in the standard, this always produces a ++ // reference type. ++ typedef decltype(true ? declval<A>() : declval<B>()) type; ++ }; ++} ++ ++#else ++ ++#define BE_THE_HEADER ++#include "libstdcxx_common_type_hack.cpp" ++ ++using T = int; ++using T = std::common_type<int, int>::type; ++ ++using U = int; // expected-note {{here}} ++using U = decltype(true ? std::declval<int>() : std::declval<int>()); // expected-error {{different types}} ++ ++#endif +Index: lib/Sema/SemaTemplateInstantiateDecl.cpp +=================================================================== +--- lib/Sema/SemaTemplateInstantiateDecl.cpp (revision 166454) ++++ lib/Sema/SemaTemplateInstantiateDecl.cpp (revision 166455) +@@ -158,6 +158,22 @@ + SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType()); + } + ++ // HACK: g++ has a bug where it gets the value kind of ?: wrong. ++ // libstdc++ relies upon this bug in its implementation of common_type. ++ // If we happen to be processing that implementation, fake up the g++ ?: ++ // semantics. See LWG issue 2141 for more information on the bug. ++ const DecltypeType *DT = DI->getType()->getAs<DecltypeType>(); ++ CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D->getDeclContext()); ++ if (DT && RD && isa<ConditionalOperator>(DT->getUnderlyingExpr()) && ++ DT->isReferenceType() && ++ RD->getEnclosingNamespaceContext() == SemaRef.getStdNamespace() && ++ RD->getIdentifier() && RD->getIdentifier()->isStr("common_type") && ++ D->getIdentifier() && D->getIdentifier()->isStr("type") && ++ SemaRef.getSourceManager().isInSystemHeader(D->getLocStart())) ++ // Fold it to the (non-reference) type which g++ would have produced. ++ DI = SemaRef.Context.getTrivialTypeSourceInfo( ++ DI->getType().getNonReferenceType()); ++ + // Create the new typedef + TypedefNameDecl *Typedef; + if (IsTypeAlias) |