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

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