mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Bug 550096 - Fix format function parameters in macro expansion
Change-Id: I509e434032a49a853e1794ab2d4b5a6a864eb5da Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
This commit is contained in:
parent
f8316e315b
commit
5c77776dcd
2 changed files with 13 additions and 2 deletions
|
@ -2483,8 +2483,10 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
||||||
*/
|
*/
|
||||||
private void formatList(List<?> elements, ListOptions options, boolean encloseInParen, boolean addEllipsis,
|
private void formatList(List<?> elements, ListOptions options, boolean encloseInParen, boolean addEllipsis,
|
||||||
Runnable tailFormatter, Runnable prefix) {
|
Runnable tailFormatter, Runnable prefix) {
|
||||||
if (encloseInParen)
|
if (encloseInParen) {
|
||||||
scribe.printNextToken(options.leftToken, options.fSpaceBeforeOpeningParen);
|
if (peekNextToken() == options.leftToken)
|
||||||
|
scribe.printNextToken(options.leftToken, options.fSpaceBeforeOpeningParen);
|
||||||
|
}
|
||||||
|
|
||||||
final int elementsLength = elements.size();
|
final int elementsLength = elements.size();
|
||||||
if (encloseInParen) {
|
if (encloseInParen) {
|
||||||
|
|
|
@ -4699,4 +4699,13 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
public void testStructuredBindingInSwitchInitStatement() throws Exception {
|
public void testStructuredBindingInSwitchInitStatement() throws Exception {
|
||||||
assertFormatterResult();
|
assertFormatterResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#define PROTO(X) X
|
||||||
|
//void foo PROTO((char* b));
|
||||||
|
|
||||||
|
//#define PROTO(X) X
|
||||||
|
//void foo PROTO((char* b));
|
||||||
|
public void testMacroInFunctionParameters_Bug550096() throws Exception {
|
||||||
|
assertFormatterResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue