public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/103879] New: error: accessing value of variant::_Copy_ctor_base through a 'const variant<string>' glvalue in a constant expression
@ 2021-12-31 15:33 hewillk at gmail dot com
  2021-12-31 22:10 ` [Bug libstdc++/103879] " pinskia at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: hewillk at gmail dot com @ 2021-12-31 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103879
           Summary: error: accessing value of variant::_Copy_ctor_base
                    through a 'const variant<string>' glvalue in a
                    constant expression
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

From
https://stackoverflow.com/questions/70541636/stdvariant-of-stdstring-inside-any-class-in-constexpr-context-fails-to-compi

#include <string>
#include <variant>

struct S {
  std::variant<std::string> v;
};

constexpr int func() {
  S s{"str"};
  return 0;
}

constexpr int x = func();

I think this should be well-formed.

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

end of thread, other threads:[~2022-10-05 23:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-31 15:33 [Bug libstdc++/103879] New: error: accessing value of variant::_Copy_ctor_base through a 'const variant<string>' glvalue in a constant expression hewillk at gmail dot com
2021-12-31 22:10 ` [Bug libstdc++/103879] " pinskia at gcc dot gnu.org
2021-12-31 22:10 ` pinskia at gcc dot gnu.org
2021-12-31 23:44 ` lhlaurini at hotmail dot com
2022-01-01 16:45 ` redi at gcc dot gnu.org
2022-01-04  4:57 ` ppalka at gcc dot gnu.org
2022-01-04 14:13 ` [Bug c++/103879] " ppalka at gcc dot gnu.org
2022-01-05 16:20 ` hewillk at gmail dot com
2022-01-05 16:23 ` redi at gcc dot gnu.org
2022-01-05 18:53 ` ppalka at gcc dot gnu.org
2022-01-06  1:57 ` hewillk at gmail dot com
2022-01-10 19:59 ` cvs-commit at gcc dot gnu.org
2022-01-10 20:01 ` ppalka at gcc dot gnu.org
2022-10-05 23:20 ` pinskia 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).