clang-format: Improve braced init list detection:
Before:
std::this_thread::sleep_for(std::chrono::nanoseconds{
std::chrono::seconds { 1 }
} /
5);
After:
std::this_thread::sleep_for(
std::chrono::nanoseconds{ std::chrono::seconds{ 1 } } / 5);
This fixes llvm.org/PR16554.
llvm-svn: 189451
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 51ada26..274d6e0 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4159,6 +4159,9 @@
" // comment 2\n"
" param3, param4\n"
" });");
+ verifyFormat(
+ "std::this_thread::sleep_for(\n"
+ " std::chrono::nanoseconds{ std::chrono::seconds{ 1 } } / 5);");
FormatStyle NoSpaces = getLLVMStyle();
NoSpaces.Cpp11BracedListStyle = true;