diff options
Diffstat (limited to 'clang/unittests/Format')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 34206e9e418..a1b0e5fee74 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -11588,6 +11588,11 @@ TEST_F(FormatTest, StructuredBindings) { format("auto const volatile &&[a, b] = f();")); EXPECT_EQ("auto && [a, b] = f();", format("auto &&[a, b] = f();")); + // Make sure we don't mistake structured bindings for lambdas. + verifyFormat("auto [a, b]{A * i};"); + verifyFormat("auto const [a, b]{A * i};"); + verifyFormat("auto const && [a, b]{A * i};"); + format::FormatStyle Spaces = format::getLLVMStyle(); Spaces.SpacesInSquareBrackets = true; verifyFormat("auto [ a, b ] = f();", Spaces); |

