summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 886f58093de..1846aa68490 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4678,6 +4678,32 @@ TEST_F(FormatTest, DefinitionReturnTypeBreakingStyle) {
"}\n"
"template <class T> T *f(T &c);\n", // No break here.
Style);
+ verifyFormat("class C {\n"
+ " int\n"
+ " operator+() {\n"
+ " return 1;\n"
+ " }\n"
+ " int\n"
+ " operator()() {\n"
+ " return 1;\n"
+ " }\n"
+ "};\n",
+ Style);
+ verifyFormat("void\n"
+ "A::operator()() {}\n"
+ "void\n"
+ "A::operator>>() {}\n"
+ "void\n"
+ "A::operator+() {}\n",
+ Style);
+ verifyFormat("void *operator new(std::size_t s);", // No break here.
+ Style);
+ verifyFormat("void *\n"
+ "operator new(std::size_t s) {}",
+ Style);
+ verifyFormat("void *\n"
+ "operator delete[](void *ptr) {}",
+ Style);
Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup;
verifyFormat("const char *\n"
"f(void)\n" // Break here.
OpenPOWER on IntegriCloud