Before:
template <enum E> class A { public : E *f(); };
After:
template <enum E> class A {
public:
E *f();
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268878
91177308-0d34-0410-b5e6-
96231b3b80d8
break;
}
do {
+ const FormatToken *Previous = getPreviousToken();
switch (FormatTok->Tok.getKind()) {
case tok::at:
nextToken();
parseBracedList();
break;
case tok::kw_enum:
+ // Ignore if this is part of "template <enum ...".
+ if (Previous && Previous->is(tok::less)) {
+ nextToken();
+ break;
+ }
+
// parseEnum falls through and does not yet add an unwrapped line as an
// enum definition can start a structural element.
if (!parseEnum())
verifyFormat("template <typename T> // T can be A, B or C.\n"
"struct C {};",
AlwaysBreak);
+ verifyFormat("template <enum E> class A {\n"
+ "public:\n"
+ " E *f();\n"
+ "};");
}
TEST_F(FormatTest, WrapsAtNestedNameSpecifiers) {