public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102236] New: emplace_deref is not constexpr for join_view
@ 2021-09-07 23:20 barry.revzin at gmail dot com
  2021-09-08  2:25 ` [Bug c++/102236] " hewillk at gmail dot com
  2021-09-08  7:42 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: barry.revzin at gmail dot com @ 2021-09-07 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102236
           Summary: emplace_deref is not constexpr for join_view
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

For instance:

#include <ranges>

constexpr std::string_view first_n_words(std::string_view str, size_t n) {    
    namespace rv = std::views;
    auto first_n = str
                | rv::split(' ')
                | rv::take(n)
                | rv::join;   

    return std::string_view(&*first_n.begin(), std::ranges::distance(first_n));
}

constexpr std::string_view first4 = first_n_words("Hello to all you beautiful
libstdc++ developers", 4);

This doesn't compile because _M_emplace_deref isn't marked constexpr (probably
becase P2231 isn't implemented yet, but thought I'd file a bug report anyway).

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

* [Bug c++/102236] emplace_deref is not constexpr for join_view
  2021-09-07 23:20 [Bug c++/102236] New: emplace_deref is not constexpr for join_view barry.revzin at gmail dot com
@ 2021-09-08  2:25 ` hewillk at gmail dot com
  2021-09-08  7:42 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: hewillk at gmail dot com @ 2021-09-08  2:25 UTC (permalink / raw)
  To: gcc-bugs

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

康桓瑋 <hewillk at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hewillk at gmail dot com

--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
This is obviously a dup of PR101263 ;-)

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

* [Bug c++/102236] emplace_deref is not constexpr for join_view
  2021-09-07 23:20 [Bug c++/102236] New: emplace_deref is not constexpr for join_view barry.revzin at gmail dot com
  2021-09-08  2:25 ` [Bug c++/102236] " hewillk at gmail dot com
@ 2021-09-08  7:42 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-09-08  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
dup

*** This bug has been marked as a duplicate of bug 101263 ***

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

end of thread, other threads:[~2021-09-08  7:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 23:20 [Bug c++/102236] New: emplace_deref is not constexpr for join_view barry.revzin at gmail dot com
2021-09-08  2:25 ` [Bug c++/102236] " hewillk at gmail dot com
2021-09-08  7:42 ` rguenth 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).