mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Bug 559545 - Fix formatter with enums with standard attributes
Change-Id: I993e773792105e22b9c2f703488e7ff211ed4068 Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
This commit is contained in:
parent
24ce60ba3f
commit
c775a210e1
2 changed files with 11 additions and 0 deletions
|
@ -1195,6 +1195,8 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
|||
// name
|
||||
enumerator.getName().accept(this);
|
||||
|
||||
formatAttributes(enumerator, true, false, ICPPASTAttributeList.TYPE_FILTER);
|
||||
|
||||
// optional value assignment
|
||||
final IASTExpression value = enumerator.getValue();
|
||||
if (value != null) {
|
||||
|
|
|
@ -4708,4 +4708,13 @@ public class CodeFormatterTest extends BaseUITestCase {
|
|||
public void testMacroInFunctionParameters_Bug550096() throws Exception {
|
||||
assertFormatterResult();
|
||||
}
|
||||
|
||||
//enum {A[[maybe_unused]],B[[maybe_unused]]=42};
|
||||
|
||||
//enum {
|
||||
// A [[maybe_unused]], B [[maybe_unused]] = 42
|
||||
//};
|
||||
public void testEnumWithAttributes_Bug559545() throws Exception {
|
||||
assertFormatterResult();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue