aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppdefault.cc
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2022-08-10 14:04:29 -0700
committerMarc Poulhiès <poulhies@adacore.com>2022-09-06 09:14:21 +0200
commitc56c7d3aeb050ddfe7a41cc00ce5eaa5c4edd636 (patch)
treeb1359d98e90bbce8161e9765f3eec774d86a51c8 /gcc/cppdefault.cc
parent6d16658d7d0aa0b3d1cede5d7a5853b2d62caf1c (diff)
downloadgcc-c56c7d3aeb050ddfe7a41cc00ce5eaa5c4edd636.zip
gcc-c56c7d3aeb050ddfe7a41cc00ce5eaa5c4edd636.tar.gz
gcc-c56c7d3aeb050ddfe7a41cc00ce5eaa5c4edd636.tar.bz2
[Ada] Cope with scalar subtypes that have a non-scalar basetype.
In some cases, the compiler builds a subtype entity Typ such that Is_Scalar (Typ) is True and Is_Scalar (Base_Type (Typ)) is False. This comes up in some cases involving a subtype of a private type, where the full view of the private type is a scalar type. In such a situation, it may also be the case that Is_Enumeration_Type (Typ) is True and Is_Enumeration_Type (Base_Type (Typ)) is False. Some code incorrectly assumed that if a subtype is known to be a scalar (respectively, enumeration) type, then the same must be true of the base type of that subtype. Fix that code to handle the case where that assumption does not hold. gcc/ada/ * exp_attr.adb (Attribute_Valid): Ensure that PBtyp is initialized to a value for which Is_Scalar_Type is True. * checks.adb (Determine_Range): Call Implemention_Base_Type instead of Base_Type in order to ensure that result is suitable for passing to Enum_Pos_To_Rep.
Diffstat (limited to 'gcc/cppdefault.cc')
0 files changed, 0 insertions, 0 deletions