[Bug libstdc++/88341] [9 Regression] taking norm() of complex variable fails to compile with -std=c++11
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 3 20:35:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88341
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2018-12-03
Known to work| |8.2.0
Assignee|unassigned at gcc dot gnu.org |emsr at gcc dot gnu.org
Ever confirmed|0 |1
Known to fail| |9.0
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Caused by r266416
The fix is simple:
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -659,7 +659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Norm_helper
{
template<typename _Tp>
- static inline _GLIBCXX_CONSTEXPR _Tp _S_do_it(const complex<_Tp>& __z)
+ static inline _GLIBCXX20_CONSTEXPR _Tp _S_do_it(const complex<_Tp>&
__z)
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
@@ -671,7 +671,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Norm_helper<true>
{
template<typename _Tp>
- static inline _GLIBCXX_CONSTEXPR _Tp _S_do_it(const complex<_Tp>& __z)
+ static inline _GLIBCXX20_CONSTEXPR _Tp _S_do_it(const complex<_Tp>&
__z)
{
//_Tp __res = std::abs(__z);
//return __res * __res;
More information about the Gcc-bugs
mailing list