clang-format: Fix overloaded operator for global-scoped conversions.

Before:
  operator::A();

After:
  operator ::A();

llvm-svn: 193605
This commit is contained in:
Daniel Jasper 2013-10-29 12:24:23 +00:00
parent cb4e7550eb
commit edc5f09175
2 changed files with 2 additions and 1 deletions

View File

@ -1337,7 +1337,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
if (Tok.Type == TT_CtorInitializerColon || Tok.Type == TT_ObjCBlockLParen)
return true;
if (Tok.Previous->Tok.is(tok::kw_operator))
return false;
return Tok.is(tok::coloncolon);
if (Tok.Type == TT_OverloadedOperatorLParen)
return false;
if (Tok.is(tok::colon))

View File

@ -3902,6 +3902,7 @@ TEST_F(FormatTest, UnderstandsOverloadedOperators) {
verifyGoogleFormat("operator void*();");
verifyGoogleFormat("operator SomeType<SomeType<int>>();");
verifyGoogleFormat("operator ::A();");
verifyFormat("using A::operator+;");
}