diff options
| author | Daniel Jasper <djasper@google.com> | 2018-03-22 14:30:28 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2018-03-22 14:30:28 +0000 |
| commit | d5e9ff4fe20e66d53a245645c95f0bb816b747cb (patch) | |
| tree | 22da1c578c51db62739f670edec6e76082487f17 /clang/lib | |
| parent | 301faac18be3855f2b742accc5e1b0f71ea8e3c7 (diff) | |
| download | bcm5719-llvm-d5e9ff4fe20e66d53a245645c95f0bb816b747cb.tar.gz bcm5719-llvm-d5e9ff4fe20e66d53a245645c95f0bb816b747cb.zip | |
clang-format: Fix SpacesInParentheses with fully qualified names.
When SpacesInParentheses is set to true clang-format does not add a
space before fully qualified names. For example:
do_something(::globalVar );
Fix by Darby Payne. Thank you!
llvm-svn: 328200
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 681e790f877..7fa2ff7f2eb 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -2692,7 +2692,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, Style.Standard == FormatStyle::LS_Cpp03) || !(Left.isOneOf(tok::l_paren, tok::r_paren, tok::l_square, tok::kw___super, TT_TemplateCloser, - TT_TemplateOpener)); + TT_TemplateOpener)) || + (Left.is(tok ::l_paren) && Style.SpacesInParentheses); if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser))) return Style.SpacesInAngles; // Space before TT_StructuredBindingLSquare. |

