public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marc.glisse at normalesup dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/51013] complex::{imag,real}() should maintain lvalue-returning extension in C++11
Date: Tue, 08 Nov 2011 07:47:00 -0000	[thread overview]
Message-ID: <bug-51013-4-TuLTmH56Vq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51013-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51013

--- Comment #6 from Marc Glisse <marc.glisse at normalesup dot org> 2011-11-08 07:44:27 UTC ---
(In reply to comment #4)
> I'm sorry, I misunderstood you, you meant C++11 does not mandate the constexpr
> in the primary. Actually, I guess it doesn't hurt,

I agree, it was your expression "per the letter" that confused me, but I am
fine with the code.

(In reply to comment #5)
> Hmm, I think adding the overloads would interfere with usage of complex
> temporaries in a constant expression.

Really ? std::bitset seems to have this kind of overload for operator[].
Surprisingly, it is the only type that does, most only have a constexpr
constructor, so I am not sure if there is a bug in bitset, a missing feature
elsewhere, or if the situations are different.

Actually, it seems that with 4.7,libstdc++ provides a constexpr overload for
array::operator[] as an extension, which seems to answer the question.

Or do you mean that the following would cause trouble (which seems likely, but
I don't have any compiler at hand that supports both constexpr and *this
references)?
constexpr _Tp real()const&;
_Tp&real()&;
_Tp real()&&;


  parent reply	other threads:[~2011-11-08  7:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 21:10 [Bug libstdc++/51013] New: " jyasskin at gcc dot gnu.org
2011-11-07 21:11 ` [Bug libstdc++/51013] " paolo.carlini at oracle dot com
2011-11-07 23:48 ` marc.glisse at normalesup dot org
2011-11-08  0:11 ` paolo.carlini at oracle dot com
2011-11-08  0:30 ` paolo.carlini at oracle dot com
2011-11-08  1:11 ` jason at gcc dot gnu.org
2011-11-08  7:47 ` marc.glisse at normalesup dot org [this message]
2011-11-08  8:13 ` paolo.carlini at oracle dot com
2011-11-08 15:20 ` jason at gcc dot gnu.org
2011-11-08 15:53 ` marc.glisse at normalesup dot org
2011-11-08 18:36 ` daniel.kruegler at googlemail dot com
2011-11-08 18:49 ` marc.glisse at normalesup dot org
2011-11-09 10:42 ` daniel.kruegler at googlemail dot com
2013-07-11 15:03 ` glisse at gcc dot gnu.org
2015-09-06 18:09 ` ross.martin at ieee dot org
2015-09-06 18:45 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-51013-4-TuLTmH56Vq@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).