From: John McCall Date: Sat, 9 Jul 2011 02:30:03 +0000 (+0000) Subject: GCC 4.2 compatibility hack. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7566aa2e47c2452f06cd59917748299065e83607;p=clang GCC 4.2 compatibility hack. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134785 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 5ce7b3374e..3d9691d20a 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -1099,11 +1099,12 @@ void CodeGenFunction::EmitAutoVarCleanups(const AutoVarEmission &emission) { CodeGenFunction::Destroyer & CodeGenFunction::getDestroyer(QualType::DestructionKind kind) { + // GCC 4.2 requires the *& on these function references. switch (kind) { case QualType::DK_none: llvm_unreachable("no destroyer for trivial dtor"); - case QualType::DK_cxx_destructor: return destroyCXXObject; - case QualType::DK_objc_strong_lifetime: return destroyARCStrongPrecise; - case QualType::DK_objc_weak_lifetime: return destroyARCWeak; + case QualType::DK_cxx_destructor: return *&destroyCXXObject; + case QualType::DK_objc_strong_lifetime: return *&destroyARCStrongPrecise; + case QualType::DK_objc_weak_lifetime: return *&destroyARCWeak; } }