The explicit type specified for an enum can actually have a nested name
specifier.
This fixes llvm.org/PR17125.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190208
91177308-0d34-0410-b5e6-
96231b3b80d8
if (FormatTok->Tok.is(tok::kw_class) ||
FormatTok->Tok.is(tok::kw_struct))
nextToken();
- while (FormatTok->Tok.getIdentifierInfo() || FormatTok->Tok.is(tok::colon)) {
+ while (FormatTok->Tok.getIdentifierInfo() ||
+ FormatTok->isOneOf(tok::colon, tok::coloncolon)) {
nextToken();
// We can have macros or attributes in between 'enum' and the enum name.
if (FormatTok->Tok.is(tok::l_paren)) {
" A,\n"
" B\n"
"};");
+ verifyFormat("enum X : std::uint32_t {\n"
+ " A,\n"
+ " B\n"
+ "};");
}
TEST_F(FormatTest, FormatsBitfields) {