public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46133] New: constexpr needed for C99 complex type creation from ctor with two floating point types
@ 2010-10-22 14:53 bkoz at gcc dot gnu.org
  2010-10-22 17:20 ` [Bug c++/46133] " jason at gcc dot gnu.org
  2010-11-02  2:35 ` jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: bkoz at gcc dot gnu.org @ 2010-10-22 14:53 UTC (permalink / raw)
  To: gcc-bugs

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)’


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-02  2:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22 14:53 [Bug c++/46133] New: constexpr needed for C99 complex type creation from ctor with two floating point types bkoz at gcc dot gnu.org
2010-10-22 17:20 ` [Bug c++/46133] " jason at gcc dot gnu.org
2010-11-02  2:35 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).