]> granicus.if.org Git - clang/commit
[clang-format] C++11 braced lists should respect the SpacesInParentheses setting
authorPaul Hoad <mydeveloperday@gmail.com>
Fri, 4 Oct 2019 14:25:20 +0000 (14:25 +0000)
committerPaul Hoad <mydeveloperday@gmail.com>
Fri, 4 Oct 2019 14:25:20 +0000 (14:25 +0000)
commita30cb89ed61188fd0f66ddc1e11fe96c2d0ccf8f
tree79f232de074b3e41b8edfea8429ffabbc43a7769
parent96aaa24db16a88715a6b8e92a4929e48d12f3835
[clang-format] C++11 braced lists should respect the SpacesInParentheses setting

Summary:
According to the clang-format documentation, "Fundamentally, C++11 braced lists are formatted exactly like function calls would be formatted in their place. If the braced list follows a name (e.g. a type or variable name), clang-format formats as if the `{}` were the parentheses of a function call with that name."

This patch furthers the treatment of C++11 braced list braces as parentheses by respecting the `SpacesInParentheses` setting.

Reviewers: MyDeveloperDay, reuk, owenpan

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang-format, #clang

Patch By: mitchell-stellar

Differential Revision: https://reviews.llvm.org/D68415

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373751 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp