Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2010-02-09 11:15:17 +0000
committerAnton Leherbauer2010-02-09 11:15:17 +0000
commit61ddde712eebece437fb35f599ac10818b425c4d (patch)
treef6a1442b3524d983f12449c82e0ad17116e83a3a
parentd94e66d0c24b25758027cdf6897cce61f4f10143 (diff)
downloadorg.eclipse.cdt-61ddde712eebece437fb35f599ac10818b425c4d.tar.gz
org.eclipse.cdt-61ddde712eebece437fb35f599ac10818b425c4d.tar.xz
org.eclipse.cdt-61ddde712eebece437fb35f599ac10818b425c4d.zip
Bug 301366 - [formatter] throw; invalidates indenting rules
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java8
1 files changed, 5 insertions, 3 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 a3715705091..cae14ab0de9 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
@@ -2055,10 +2055,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
break;
case IASTUnaryExpression.op_throw:
scribe.printNextToken(Token.t_throw, scribe.printComment());
- if (peekNextToken() != Token.tLPAREN) {
- scribe.space();
+ if (operand != null) {
+ if (peekNextToken() != Token.tLPAREN) {
+ scribe.space();
+ }
+ operand.accept(this);
}
- operand.accept(this);
break;
case IASTUnaryExpression.op_typeid:
scribe.printNextToken(Token.t_typeid, scribe.printComment());

Back to the top