mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 12:05:21 +02:00
Bug 545756 - Handle the case where CPPVisitor.get_SIZE_T() returns a typedef
Change-Id: Ib30c68c4d7de72d9a6cb2a90b9030aaad4932e6f
This commit is contained in:
parent
682a4e69fc
commit
26e9f5e787
1 changed files with 12 additions and 4 deletions
|
@ -160,10 +160,18 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
|
||||||
case op_sizeof:
|
case op_sizeof:
|
||||||
case op_sizeofParameterPack:
|
case op_sizeofParameterPack:
|
||||||
case op_alignof:
|
case op_alignof:
|
||||||
CPPBasicType t = (CPPBasicType) CPPVisitor.get_SIZE_T().clone();
|
IType result = (IType) CPPVisitor.get_SIZE_T().clone();
|
||||||
if (getValue().numberValue() != null)
|
IType simplifiedResult = SemanticUtil.getSimplifiedType(result);
|
||||||
t.setAssociatedNumericalValue(getValue().numberValue().longValue());
|
if (simplifiedResult instanceof CPPBasicType) {
|
||||||
return t;
|
CPPBasicType t = (CPPBasicType) simplifiedResult;
|
||||||
|
IValue value = getValue();
|
||||||
|
if (value != null && value.numberValue() != null) {
|
||||||
|
t.setAssociatedNumericalValue(value.numberValue().longValue());
|
||||||
|
}
|
||||||
|
// We're still returning 'result', which is now modified.
|
||||||
|
// This preserves the 'size_t' typedef.
|
||||||
|
}
|
||||||
|
return result;
|
||||||
case op_typeid:
|
case op_typeid:
|
||||||
return CPPVisitor.get_type_info();
|
return CPPVisitor.get_type_info();
|
||||||
case op_has_nothrow_copy:
|
case op_has_nothrow_copy:
|
||||||
|
|
Loading…
Add table
Reference in a new issue