From 35ce55c79fc58716ec67cac8415acd9f58e32b7e Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Thu, 20 Jul 2017 10:25:00 +0000 Subject: [PATCH] [globalisel][tablegen] Fix an issue with lambdas when compiling with older GCC's It seems that G++ 4.8 doesn't accept the 'enum A' in code of the form: enum A { ... }; const auto &F = []() -> enum A { ... }; However, it does accept: typedef enum { ... } A; const auto &F = []() -> A { ... }; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308599 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h b/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h index 5424e4e5ad2..322ddce2295 100644 --- a/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h +++ b/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h @@ -29,8 +29,8 @@ bool InstructionSelector::executeMatchTable( uint64_t CurrentIdx = 0; SmallVector OnFailResumeAt; - enum RejectAction { RejectAndGiveUp, RejectAndResume }; - auto handleReject = [&]() -> enum RejectAction { + typedef enum { RejectAndGiveUp, RejectAndResume } RejectAction; + auto handleReject = [&]() -> RejectAction { DEBUG(dbgs() << CurrentIdx << ": Rejected\n"); if (OnFailResumeAt.empty()) return RejectAndGiveUp; -- 2.50.1