mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Bug 285901 - Format function does not work properly when define constant to type cast
This commit is contained in:
parent
3b8ad5a4cd
commit
a75cc9c45a
2 changed files with 18 additions and 2 deletions
|
@ -1886,8 +1886,15 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
scribe.space();
|
scribe.space();
|
||||||
}
|
}
|
||||||
node.getTypeId().accept(this);
|
node.getTypeId().accept(this);
|
||||||
scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_cast);
|
try {
|
||||||
if (preferences.insert_space_after_closing_paren_in_cast) {
|
if (node.getTypeId().getTrailingSyntax().getType() == IToken.tRPAREN) {
|
||||||
|
scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_cast);
|
||||||
|
if (preferences.insert_space_after_closing_paren_in_cast) {
|
||||||
|
scribe.space();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (UnsupportedOperationException exc) {
|
||||||
|
} catch (ExpansionOverlapsBoundaryException exc) {
|
||||||
scribe.space();
|
scribe.space();
|
||||||
}
|
}
|
||||||
// operand
|
// operand
|
||||||
|
|
|
@ -1347,4 +1347,13 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
public void testWideStringLiteral_Bug292626() throws Exception {
|
public void testWideStringLiteral_Bug292626() throws Exception {
|
||||||
assertFormatterResult();
|
assertFormatterResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#define INT (int)
|
||||||
|
//int i = INT 1;
|
||||||
|
|
||||||
|
//#define INT (int)
|
||||||
|
//int i = INT 1;
|
||||||
|
public void testCastAsMacro_Bug285901() throws Exception {
|
||||||
|
assertFormatterResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue