Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHansruedi Patzen2018-05-30 07:23:56 -0400
committerThomas Corbat2018-06-15 02:53:27 -0400
commita9988957f653cf75d24b12180658f266d6dd9f16 (patch)
tree79679954f7557fa8c12d8c2a9313980e0c272db4 /core/org.eclipse.cdt.core/parser/org
parent3f98811f7326e0eb94c745489985183e4bec2d7a (diff)
downloadorg.eclipse.cdt-a9988957f653cf75d24b12180658f266d6dd9f16.tar.gz
org.eclipse.cdt-a9988957f653cf75d24b12180658f266d6dd9f16.tar.xz
org.eclipse.cdt-a9988957f653cf75d24b12180658f266d6dd9f16.zip
Bug 535331: Rewriting sizeof...() drops the parenthesis
Fix and test. Change-Id: If54f24d833724f3c51ae0b6e7f325493e5110719 Signed-off-by: Hansruedi Patzen <hansruedi.patzen@hsr.ch> Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
index eec6ecfe32..26748d7efc 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
@@ -71,7 +71,7 @@ public class ExpressionWriter extends NodeWriter{
private static final String TYPEID_OP = "typeid ("; //$NON-NLS-1$
private static final String OPEN_BRACKET_OP = "("; //$NON-NLS-1$
private static final String SIZEOF_OP = "sizeof "; //$NON-NLS-1$
- private static final String SIZEOF_PARAMETER_PACK_OP = "sizeof..."; //$NON-NLS-1$
+ private static final String SIZEOF_PARAMETER_PACK_OP = "sizeof...("; //$NON-NLS-1$
private static final String NOEXCEPT_OP = "noexcept ("; //$NON-NLS-1$
private static final String NOT_OP = "!"; //$NON-NLS-1$
private static final String TILDE_OP = "~"; //$NON-NLS-1$
@@ -274,6 +274,7 @@ public class ExpressionWriter extends NodeWriter{
case ICPPASTUnaryExpression.op_typeid:
case ICPPASTUnaryExpression.op_noexcept:
case IASTUnaryExpression.op_alignOf:
+ case IASTUnaryExpression.op_sizeofParameterPack:
return true;
default:
@@ -333,6 +334,7 @@ public class ExpressionWriter extends NodeWriter{
case ICPPASTUnaryExpression.op_noexcept:
case IASTUnaryExpression.op_bracketedPrimary:
case IASTUnaryExpression.op_alignOf:
+ case IASTUnaryExpression.op_sizeofParameterPack:
return CLOSING_BRACKET_OP;
default:
System.err.println("Unkwown unaryExpressionType " + unaryExpressionType); //$NON-NLS-1$
@@ -519,7 +521,7 @@ public class ExpressionWriter extends NodeWriter{
case IASTTypeIdExpression.op_typeof:
return TYPEOF_OP;
case IASTTypeIdExpression.op_sizeofParameterPack:
- return SIZEOF_PARAMETER_PACK_OP + "("; //$NON-NLS-1$
+ return SIZEOF_PARAMETER_PACK_OP;
}
throw new IllegalArgumentException("Unknown TypeId Type"); //$NON-NLS-1$
}

Back to the top