diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-12 02:09:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-12 02:09:03 +0000 |
commit | 775118a28bcaead62e6db7bf1959e0503691d185 (patch) | |
tree | 209308ea930c2d1a4938fcb808e354f42737a8f6 /clang/lib/Sema/TreeTransform.h | |
parent | 45dc480b7514ca7760d3ed25f9e86d50e47a43e2 (diff) | |
download | bcm5719-llvm-775118a28bcaead62e6db7bf1959e0503691d185.tar.gz bcm5719-llvm-775118a28bcaead62e6db7bf1959e0503691d185.zip |
Try a different workaround for GCC 4.7.2 lambda capture bug. The previous
workaround took us from wrong-code to ICE.
llvm-svn: 221754
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index ecbc0118bb8..62475bc707e 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -4579,12 +4579,12 @@ QualType TreeTransform<Derived>::TransformFunctionProtoType(TypeLocBuilder &TLB, FunctionProtoTypeLoc TL) { SmallVector<QualType, 4> ExceptionStorage; + TreeTransform *This = this; // Work around gcc.gnu.org/PR56135. return getDerived().TransformFunctionProtoType( TLB, TL, nullptr, 0, - // The explicit 'this' capture is a workaround for gcc.gnu.org/PR56135. - [&, this](FunctionProtoType::ExceptionSpecInfo & ESI, bool &Changed) { - return TransformExceptionSpec(TL.getBeginLoc(), ESI, ExceptionStorage, - Changed); + [&](FunctionProtoType::ExceptionSpecInfo &ESI, bool &Changed) { + return This->TransformExceptionSpec(TL.getBeginLoc(), ESI, + ExceptionStorage, Changed); }); } @@ -9152,11 +9152,12 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) { TypeLocBuilder NewCallOpTLBuilder; SmallVector<QualType, 4> ExceptionStorage; + TreeTransform *This = this; // Work around gcc.gnu.org/PR56135. QualType NewCallOpType = TransformFunctionProtoType( NewCallOpTLBuilder, OldCallOpFPTL, nullptr, 0, - [&, this](FunctionProtoType::ExceptionSpecInfo &ESI, bool &Changed) { - return TransformExceptionSpec(OldCallOpFPTL.getBeginLoc(), ESI, - ExceptionStorage, Changed); + [&](FunctionProtoType::ExceptionSpecInfo &ESI, bool &Changed) { + return This->TransformExceptionSpec(OldCallOpFPTL.getBeginLoc(), ESI, + ExceptionStorage, Changed); }); NewCallOpTSI = NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context, NewCallOpType); |