forked from OSchip/llvm-project
clang-format: Fix overloaded operator for global-scoped conversions.
Before: operator::A(); After: operator ::A(); llvm-svn: 193605
This commit is contained in:
parent
cb4e7550eb
commit
edc5f09175
|
@ -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))
|
||||
|
|
|
@ -3902,6 +3902,7 @@ TEST_F(FormatTest, UnderstandsOverloadedOperators) {
|
|||
|
||||
verifyGoogleFormat("operator void*();");
|
||||
verifyGoogleFormat("operator SomeType<SomeType<int>>();");
|
||||
verifyGoogleFormat("operator ::A();");
|
||||
|
||||
verifyFormat("using A::operator+;");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue