Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java
index e08dce34c8..ff508152fb 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java
@@ -160,10 +160,14 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
case op_sizeof:
case op_sizeofParameterPack:
case op_alignof:
- CPPBasicType t = (CPPBasicType) CPPVisitor.get_SIZE_T().clone();
- if (getValue().numberValue() != null)
- t.setAssociatedNumericalValue(getValue().numberValue().longValue());
- return t;
+ IType o = CPPVisitor.get_SIZE_T();
+ if (o instanceof CPPBasicType) {
+ CPPBasicType t = (CPPBasicType) o.clone();
+ if (getValue().numberValue() != null)
+ t.setAssociatedNumericalValue(getValue().numberValue().longValue());
+ return t;
+ }
+ return o;
case op_typeid:
return CPPVisitor.get_type_info();
case op_has_nothrow_copy:

Back to the top