clang-format: Fix space in decltype-constexprs.

Before:
  static constexpr bool Bar = decltype(bar()) ::value;

After:
  static constexpr bool Bar = decltype(bar())::value;

llvm-svn: 189449
This commit is contained in:
Daniel Jasper 2013-08-28 07:07:07 +00:00
parent d66476025a
commit 11be8ac590
2 changed files with 3 additions and 1 deletions

View File

@ -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))

View File

@ -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) {