mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 22:05:44 +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
|
// name
|
||||||
enumerator.getName().accept(this);
|
enumerator.getName().accept(this);
|
||||||
|
|
||||||
|
formatAttributes(enumerator, true, false, ICPPASTAttributeList.TYPE_FILTER);
|
||||||
|
|
||||||
// optional value assignment
|
// optional value assignment
|
||||||
final IASTExpression value = enumerator.getValue();
|
final IASTExpression value = enumerator.getValue();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
|
|
|
@ -4708,4 +4708,13 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
public void testMacroInFunctionParameters_Bug550096() throws Exception {
|
public void testMacroInFunctionParameters_Bug550096() throws Exception {
|
||||||
assertFormatterResult();
|
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