summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorPaul Hoad <mydeveloperday@gmail.com>2019-10-04 13:24:15 +0000
committerPaul Hoad <mydeveloperday@gmail.com>2019-10-04 13:24:15 +0000
commita37a6dcd04b0c0a0f9eea93ba0a5070a5421a29a (patch)
treee7eccc788226f1f16f210a3569b081fecd1cc5d3 /clang/unittests/Format/FormatTest.cpp
parent434d59250e3822a141fb5070ae0432f31da77734 (diff)
downloadbcm5719-llvm-a37a6dcd04b0c0a0f9eea93ba0a5070a5421a29a.tar.gz
bcm5719-llvm-a37a6dcd04b0c0a0f9eea93ba0a5070a5421a29a.zip
[clang-format] [PR42417] clang-format inserts a space after '->' for operator->() overloading
Summary: https://bugs.llvm.org/show_bug.cgi?id=42417 This revision removes the extra space between the opertor-> and the parens () ``` class Bug { auto operator-> () -> int*; auto operator++(int) -> int; }; ``` Reviewers: klimek, owenpan, byoungyoung, mitchell-stellar Reviewed By: mitchell-stellar Subscribers: cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D68242 llvm-svn: 373746
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index e982c8b2ab0..b770d0f26f8 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4956,6 +4956,10 @@ TEST_F(FormatTest, DontBreakBeforeQualifiedOperator) {
TEST_F(FormatTest, TrailingReturnType) {
verifyFormat("auto foo() -> int;\n");
+ // correct trailing return type spacing
+ verifyFormat("auto operator->() -> int;\n");
+ verifyFormat("auto operator++(int) -> int;\n");
+
verifyFormat("struct S {\n"
" auto bar() const -> int;\n"
"};");
OpenPOWER on IntegriCloud