1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 244928 - follow up

This commit is contained in:
Anton Leherbauer 2008-11-20 12:34:28 +00:00
parent 78bcda1074
commit cd8a4b82b0
2 changed files with 56 additions and 0 deletions

View file

@ -3090,6 +3090,10 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
}
if (!endsWithMacroExpansion) {
formatClosingBrace(block_brace_position);
} else {
if (DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(block_brace_position)) {
scribe.unIndent();
}
}
}

View file

@ -948,6 +948,58 @@ public class CodeFormatterTest extends BaseUITestCase {
assertFormatterResult();
}
//#define BLOCK { }
//#define DOIT1() { }
//#define DOIT2() do { } while(false)
//#define ALWAYS if(true)
//#define NEVER if(false)
//#define FOREVER for(;;)
//
//void foo() {
// int i=0;
// if (true) DOIT1();
// if (true) DOIT2();
// for (;;) BLOCK
// ALWAYS BLOCK
// NEVER FOREVER BLOCK
// switch(i) {
// case 0: BLOCK
// }
//}
//#define BLOCK { }
//#define DOIT1() { }
//#define DOIT2() do { } while(false)
//#define ALWAYS if(true)
//#define NEVER if(false)
//#define FOREVER for(;;)
//
//void
//foo()
//{
// int i = 0;
// if (true)
// DOIT1();
// if (true)
// DOIT2();
// for (;;)
// BLOCK
// ALWAYS
// BLOCK
// NEVER
// FOREVER
// BLOCK
// switch (i)
// {
// case 0:
// BLOCK
// }
//}
public void testCompoundStatementAsMacroGNU_Bug244928() throws Exception {
fOptions= DefaultCodeFormatterOptions.getGNUSettings().getMap();
assertFormatterResult();
}
//#define A (0)
//#define B (1)
//#define ARGS (A, B)