This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46133] New: constexpr needed for C99 complex type creation from ctor with two floating point types
- From: "bkoz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Oct 2010 14:53:41 +0000
- Subject: [Bug c++/46133] New: constexpr needed for C99 complex type creation from ctor with two floating point types
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46133
Summary: constexpr needed for C99 complex type creation from
ctor with two floating point types
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: bkoz@gcc.gnu.org
Small reproducer:
struct complex
{
typedef float value_type;
typedef __complex__ float _ComplexT;
constexpr complex(_ComplexT __z) : _M_value(__z) { }
constexpr complex(float __r = 0.0f, float __i = 0.0f)
: _M_value(__r + __i * 1.0fi) { }
private:
_ComplexT _M_value;
};
constexpr complex c1;
Gives:
%$bin/H-x86_64-gcc-constexpr.20101022/bin/g++ -c -std=gnu++0x complex_wanna.cc
complex_wanna.cc:16:19: error: â(__complex__ float){0.0f, 0.0f}â is not a
constant expression
complex_wanna.cc:16:19: error: in expansion of âcomplex(0.0f, 0.0f)â