Index: lib/Format/Format.cpp =================================================================== --- lib/Format/Format.cpp +++ lib/Format/Format.cpp @@ -718,6 +718,11 @@ LLVMStyle.StatementMacros.push_back("Q_UNUSED"); LLVMStyle.StatementMacros.push_back("QT_REQUIRE_VERSION"); + // Defaults that differ when not C++. + if (Language == FormatStyle::LK_TableGen) { + LLVMStyle.SpacesInContainerLiterals = false; + } + return LLVMStyle; } Index: unittests/Format/FormatTestTableGen.cpp =================================================================== --- unittests/Format/FormatTestTableGen.cpp +++ unittests/Format/FormatTestTableGen.cpp @@ -51,5 +51,9 @@ " \"very long help string\">;\n"); } +TEST_F(FormatTestTableGen, NoSpacesInSquareBracketLists) { + verifyFormat("def flag : Flag<[\"-\", \"--\"], \"foo\">;\n"); +} + } // namespace format } // end namespace clang