public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/113782] New: constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11
@ 2024-02-06 10:41 redi at gcc dot gnu.org
  2024-02-21  8:27 ` [Bug libstdc++/113782] " de34 at live dot cn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2024-02-06 10:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113782

            Bug ID: 113782
           Summary: constexpr on std::initializer_list, std::pair and
                    std::tuple is non-conforming for C++11
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

https://wg21.link/N3471 should be a C++14 change, not present in C++11 mode.

i.e. this should be rejected with -std=c++11

#include <utility>
#include <tuple>
#include <initializer_list>

constexpr std::initializer_list<int> il{1,2,3};
constexpr int i = std::move(*il.begin()) + end(il)[-1] + (int)il.size();
constexpr std::pair<int, int> p{1, 2};
constexpr int j = std::get<0>(p) + (int)(p == p);
constexpr std::tuple<int> t{1};



initializer_list changes:
r0-104226-g900484dee595d9 (this adds FE tests using -std=c++0x)

<utility> function changes:
r0-110341-g9b9e81a0a9cef8 (also touched std::pair)

std::tuple and std::pair changes:
r0-104899-g094a14eff78e4f

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

* [Bug libstdc++/113782] constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11
  2024-02-06 10:41 [Bug libstdc++/113782] New: constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11 redi at gcc dot gnu.org
@ 2024-02-21  8:27 ` de34 at live dot cn
  2024-02-21  9:27 ` redi at gcc dot gnu.org
  2024-03-18 11:46 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: de34 at live dot cn @ 2024-02-21  8:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113782

Jiang An <de34 at live dot cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |de34 at live dot cn

--- Comment #1 from Jiang An <de34 at live dot cn> ---
May be related to PR 102916. Is there any policy for "backporting" constexpr?

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

* [Bug libstdc++/113782] constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11
  2024-02-06 10:41 [Bug libstdc++/113782] New: constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11 redi at gcc dot gnu.org
  2024-02-21  8:27 ` [Bug libstdc++/113782] " de34 at live dot cn
@ 2024-02-21  9:27 ` redi at gcc dot gnu.org
  2024-03-18 11:46 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2024-02-21  9:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113782

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=102916

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We don't backport it, but these commits were all made long ago before that was
decided.

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

* [Bug libstdc++/113782] constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11
  2024-02-06 10:41 [Bug libstdc++/113782] New: constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11 redi at gcc dot gnu.org
  2024-02-21  8:27 ` [Bug libstdc++/113782] " de34 at live dot cn
  2024-02-21  9:27 ` redi at gcc dot gnu.org
@ 2024-03-18 11:46 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2024-03-18 11:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113782

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-03-18
     Ever confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We also have constexpr on some std::complex constructors that should not be
constexpr until C++14:

  template<>
    class complex<float>
    {
    public:
      typedef float value_type;
      typedef __complex__ float _ComplexT;

      _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }

      _GLIBCXX_CONSTEXPR complex(float __r = 0.0f, float __i = 0.0f)

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

end of thread, other threads:[~2024-03-18 11:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 10:41 [Bug libstdc++/113782] New: constexpr on std::initializer_list, std::pair and std::tuple is non-conforming for C++11 redi at gcc dot gnu.org
2024-02-21  8:27 ` [Bug libstdc++/113782] " de34 at live dot cn
2024-02-21  9:27 ` redi at gcc dot gnu.org
2024-03-18 11:46 ` redi 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).