This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/88341] [9 Regression] taking norm() of complex variable fails to compile with -std=c++11
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Dec 2018 20:35:19 +0000
- Subject: [Bug libstdc++/88341] [9 Regression] taking norm() of complex variable fails to compile with -std=c++11
- Auto-submitted: auto-generated
- References: <bug-88341-4@http.gcc.gnu.org/bugzilla/>
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;