diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-11-12 13:31:02 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-11-12 14:36:39 +0000 |
commit | d21776ef90361e66401cd99c8ff0d98b46d3b0d6 (patch) | |
tree | d700ed0add53cfa97723aea1088cba562031a35f /gcc/fold-const.c | |
parent | 896db49a442a15a1fa1f641cd0385da1ba1794e3 (diff) | |
download | gcc-d21776ef90361e66401cd99c8ff0d98b46d3b0d6.zip gcc-d21776ef90361e66401cd99c8ff0d98b46d3b0d6.tar.gz gcc-d21776ef90361e66401cd99c8ff0d98b46d3b0d6.tar.bz2 |
libstdc++: Simplify __numeric_traits definition
This changes the __numeric_traits primary template to assume its
argument is an integer type. For the three floating point types that are
supported by __numeric_traits_floating an explicit specialization of
__numeric_traits chooses the right base class.
This improves the failure mode for using __numeric_traits with an
unsupported type. Previously it would use __numeric_traits_floating as
the base class, and give somewhat obscure errors for trying to access
the static data members. Now it will use __numeric_traits_integer which
has a static_assert to check for supported types.
As a side effect of this change there is no need to instantiate
__conditional_type to decide which base class to use.
libstdc++-v3/ChangeLog:
* include/ext/numeric_traits.h (__numeric_traits): Change
primary template to always derive from __numeric_traits_integer.
(__numeric_traits<float>, __numeric_traits<double>)
(__numeric_traits<long double>): Add explicit specializations.
Diffstat (limited to 'gcc/fold-const.c')
0 files changed, 0 insertions, 0 deletions