diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 7f298555079..ee476b952e0 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1180,7 +1180,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, if (Left.is(tok::coloncolon)) return false; if (Right.is(tok::coloncolon)) - return !Left.isOneOf(tok::identifier, tok::greater, tok::l_paren); + return !Left.isOneOf(tok::identifier, tok::greater, tok::l_paren, + tok::r_paren); if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less)) return false; if (Right.is(tok::ellipsis)) diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 1cc4389f3aa..5002c9ce804 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -138,6 +138,7 @@ TEST_F(FormatTest, FormatsNestedCall) { TEST_F(FormatTest, NestedNameSpecifiers) { verifyFormat("vector< ::Type> v;"); verifyFormat("::ns::SomeFunction(::ns::SomeOtherFunction())"); + verifyFormat("static constexpr bool Bar = decltype(bar())::value;"); } TEST_F(FormatTest, OnlyGeneratesNecessaryReplacements) { |

