diff options
author | Jason Merrill <jason@redhat.com> | 2021-11-13 16:59:31 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-11-15 02:50:45 -0500 |
commit | 37326651b439bac55d96fb5a43f4daf25e401eda (patch) | |
tree | e3fb0cf171f0a7c86f00f6e6f065af106eb32fbd /libstdc++-v3/include/experimental | |
parent | daa9c6b015a33fa98af0ee7cd6919120248ab5f9 (diff) |
c++: check constexpr constructor body
The implicit constexpr patch revealed that our checks for constexpr
constructors that could possibly produce a constant value (which
otherwise are IFNDR) was failing to look at most of the function body.
Fixing that required some library tweaks.
gcc/cp/ChangeLog:
* constexpr.c (maybe_save_constexpr_fundef): Also check whether the
body of a constructor is potentially constant.
libstdc++-v3/ChangeLog:
* src/c++17/memory_resource.cc: Add missing constexpr.
* include/experimental/internet: Only mark copy constructor
as constexpr with __cpp_constexpr_dynamic_alloc.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/constexpr-89285-2.C: Expect error.
* g++.dg/cpp1y/constexpr-89285.C: Adjust error.
Diffstat (limited to 'libstdc++-v3/include/experimental')
-rw-r--r-- | libstdc++-v3/include/experimental/internet | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/experimental/internet b/libstdc++-v3/include/experimental/internet index 65c97de07d9..95b8cdc9963 100644 --- a/libstdc++-v3/include/experimental/internet +++ b/libstdc++-v3/include/experimental/internet @@ -460,7 +460,9 @@ namespace ip // constructors: constexpr address() noexcept : _M_v4(), _M_is_v4(true) { } +#if __cpp_constexpr_dynamic_alloc constexpr +#endif address(const address& __a) noexcept : _M_uninit(), _M_is_v4(__a._M_is_v4) { if (_M_is_v4) |