Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2007-12-13 11:52:06 +0000
committerAnton Leherbauer2007-12-13 11:52:06 +0000
commit5dee2d844dccc6eb6f422abd54b1795d5aeb29eb (patch)
tree825b6825e6c35de418c904fd95ae5d34f933f6e6
parent1ac9c7bc5c94d583c8c2c25cd1b8db071014edcf (diff)
downloadorg.eclipse.cdt-5dee2d844dccc6eb6f422abd54b1795d5aeb29eb.tar.gz
org.eclipse.cdt-5dee2d844dccc6eb6f422abd54b1795d5aeb29eb.tar.xz
org.eclipse.cdt-5dee2d844dccc6eb6f422abd54b1795d5aeb29eb.zip
Improver formatter robustness (related to 212819)
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java4
1 files changed, 2 insertions, 2 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 053e740cd7a..df53dca490d 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
@@ -326,7 +326,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
IASTNodeLocation[] locations= node.getNodeLocations();
if (locations.length == 0) {
throw new AbortFormatting("Empty location array in " + node.getClass().getName()); //$NON-NLS-1$
- } else if (locations[0] instanceof IASTMacroExpansion) {
+ } else if (locations[0] instanceof IASTMacroExpansion && !(node instanceof IASTProblemDeclaration)) {
skipNode(node);
} else
if (node instanceof IASTFunctionDefinition) {
@@ -565,7 +565,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
try {
if (locations.length == 0) {
return PROCESS_SKIP;
- } else if (locations[0] instanceof IASTMacroExpansion) {
+ } else if (locations[0] instanceof IASTMacroExpansion && !(node instanceof IASTProblemStatement)) {
skipNode(node);
} else if (locations[0].getNodeOffset()+locations[0].getNodeLength() < scribe.scanner.getCurrentPosition()) {
return PROCESS_SKIP;

Back to the top