summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
-rw-r--r--clang/unittests/Format/FormatTest.cpp9
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 14d164e2ae7..f0ffdb6d0b1 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -982,7 +982,7 @@ private:
if (PrevToken->Tok.isLiteral() ||
PrevToken->isOneOf(tok::r_paren, tok::r_square, tok::kw_true,
- tok::kw_false) ||
+ tok::kw_false, tok::r_brace) ||
NextToken->Tok.isLiteral() ||
NextToken->isOneOf(tok::kw_true, tok::kw_false) ||
NextToken->isUnaryOperator() ||
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f541cc0903f..e7c9402837c 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5034,7 +5034,14 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
"template <class T, class = typename std::enable_if<\n"
" std::is_integral<T>::value &&\n"
" (sizeof(T) > 1 || sizeof(T) < 8)>::type>\n"
- "void F();", getLLVMStyleWithColumns(76));
+ "void F();",
+ getLLVMStyleWithColumns(76));
+ verifyFormat(
+ "template <class T,\n"
+ " class = typename ::std::enable_if<\n"
+ " ::std::is_array<T>{} && ::std::is_array<T>{}>::type>\n"
+ "void F();",
+ getGoogleStyleWithColumns(68));
verifyIndependentOfContext("MACRO(int *i);");
verifyIndependentOfContext("MACRO(auto *a);");
OpenPOWER on IntegriCloud