Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Corbat2013-07-03 10:55:15 +0000
committerThomas Corbat2013-07-08 12:25:25 +0000
commite843235fc4eb91d7e74a5785d466a43957b7c48a (patch)
tree8b021a4cf224e3f262d20b0efe52e10558a13a75 /core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter
parentc658e9df68f2bf1b951845ba7187f98240fffa80 (diff)
downloadorg.eclipse.cdt-e843235fc4eb91d7e74a5785d466a43957b7c48a.tar.gz
org.eclipse.cdt-e843235fc4eb91d7e74a5785d466a43957b7c48a.tar.xz
org.eclipse.cdt-e843235fc4eb91d7e74a5785d466a43957b7c48a.zip
Bug 412187 Formatting function-like macro call in equals initializer
Added IASTExpressions to the exclusion in enterNode of CodeFormatterVisitor when encountering function like macro calls. Change-Id: I8ea6c5e7ba955299b0d6ca48c93fac275afa65e3 Reviewed-on: https://git.eclipse.org/r/14213 Reviewed-by: Thomas Corbat <tcorbat@hsr.ch> IP-Clean: Thomas Corbat <tcorbat@hsr.ch> Tested-by: Thomas Corbat <tcorbat@hsr.ch>
Diffstat (limited to 'core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
index b3ee92ac944..658d5bca0cd 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
@@ -3771,7 +3771,8 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
return true;
} else if (!fInsideMacroArguments && locations[0] instanceof IASTMacroExpansionLocation) {
IASTMacroExpansionLocation location = (IASTMacroExpansionLocation) locations[0];
- if (locations.length <= 2 && node instanceof IASTStatement) {
+ if (locations.length <= 2 &&
+ (node instanceof IASTStatement || node instanceof IASTExpression)) {
IASTPreprocessorMacroExpansion macroExpansion = location.getExpansion();
IASTFileLocation macroLocation = macroExpansion.getFileLocation();
int macroOffset = macroLocation.getNodeOffset();

Back to the top