From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9246 invoked by alias); 22 Oct 2010 14:53:46 -0000 Received: (qmail 9230 invoked by uid 22791); 22 Oct 2010 14:53:46 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Oct 2010 14:53:42 +0000 From: "bkoz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/46133] New: constexpr needed for C99 complex type creation from ctor with two floating point types X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: bkoz at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Fri, 22 Oct 2010 14:53:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg01906.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D46133 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 =3D 0.0f, float __i =3D 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=3Dgnu++0x complex_wan= na.cc complex_wanna.cc:16:19: error: =E2=80=98(__complex__ float){0.0f, 0.0f}=E2= =80=99 is not a constant expression complex_wanna.cc:16:19: error: in expansion of =E2=80=98complex(0.0f, 0.0f)= =E2=80=99