mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
Format unions like structs and classes.
Note that I don't know whether we should put {} on a single line in this case, but it is probably a theoretical issue as in practice such structs, classes or unions won't be empty. Before: union A {} a; After: union A {} a; llvm-svn: 172355
This commit is contained in:
parent
953fb087e5
commit
22cf462234
@ -317,7 +317,8 @@ void UnwrappedLineParser::parseStructuralElement() {
|
||||
case tok::kw_enum:
|
||||
parseEnum();
|
||||
return;
|
||||
case tok::kw_struct: // fallthrough
|
||||
case tok::kw_struct: // fallthrough
|
||||
case tok::kw_union: // fallthrough
|
||||
case tok::kw_class:
|
||||
parseStructClassOrBracedList();
|
||||
return;
|
||||
|
@ -343,6 +343,7 @@ TEST_F(FormatTest, FormatsDerivedClass) {
|
||||
TEST_F(FormatTest, FormatsVariableDeclarationsAfterStructOrClass) {
|
||||
verifyFormat("class A {} a, b;");
|
||||
verifyFormat("struct A {} a, b;");
|
||||
verifyFormat("union A {} a;");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, FormatsEnum) {
|
||||
|
Loading…
Reference in New Issue
Block a user