From: Mikael Holmen Date: Mon, 3 Jun 2019 06:38:01 +0000 (+0000) Subject: [TableGen] Fix std::array initializer to avoid warnings with older tool chains. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46155ae901e2284f2f6f5be8273cb9e9b5bdfc10;p=llvm [TableGen] Fix std::array initializer to avoid warnings with older tool chains. NFC A std::array is implemented as a template with an array inside a struct. Older versions of clang, like 3.6, require an extra set of curly braces around std::array initializations to avoid warnings. The C++ language was changed regarding this by CWG 1270. So more modern tool chains does not complain even if leaving out one level of braces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362360 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp index 3d3ae9c21eb..1f0db4fd123 100644 --- a/utils/TableGen/DAGISelMatcherGen.cpp +++ b/utils/TableGen/DAGISelMatcherGen.cpp @@ -692,7 +692,7 @@ void MatcherGen::EmitResultLeafAsOperand(const TreePatternNode *N, } if (Def->getName() == "undef_tied_input") { - std::array ResultVTs = { N->getSimpleType(0) }; + std::array ResultVTs = {{ N->getSimpleType(0) }}; std::array InstOps; auto IDOperandNo = NextRecordedOperandNo++; AddMatcher(new EmitNodeMatcher("TargetOpcode::IMPLICIT_DEF",