Before:
ns::E f() { return (ns::E) - 1; }
After:
ns::E f() { return (ns::E)-1; }
This fixes llvm.org/PR23503.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237684
91177308-0d34-0410-b5e6-
96231b3b80d8
}
for (; Prev != Tok.MatchingParen; Prev = Prev->Previous) {
- if (!Prev || !Prev->isOneOf(tok::kw_const, tok::identifier)) {
+ if (!Prev ||
+ !Prev->isOneOf(tok::kw_const, tok::identifier, tok::coloncolon)) {
IsCast = false;
break;
}
verifyFormat("my_int a = (const my_int)-1;");
verifyFormat("my_int a = (const my_int *)-1;");
verifyFormat("my_int a = (my_int)(my_int)-1;");
+ verifyFormat("my_int a = (ns::my_int)-2;");
// FIXME: single value wrapped with paren will be treated as cast.
verifyFormat("void f(int i = (kValue)*kMask) {}");