public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/102913] New: variant_construct_single should not remove the const qualifier of Up
@ 2021-10-24 13:18 hewillk at gmail dot com
  2021-10-24 14:12 ` [Bug libstdc++/102913] " hewillk at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: hewillk at gmail dot com @ 2021-10-24 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102913
           Summary: variant_construct_single should not remove the const
                    qualifier of Up
           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/69696170:

variant#L568:

  template<typename _Tp, typename _Up>
    _GLIBCXX20_CONSTEXPR
    void
    __variant_construct_single(_Tp&& __lhs, _Up&& __rhs_mem)
    {
      using _Type = __remove_cvref_t<_Up>;

This should be using _Type = remove_reference_t<_Up>.

#include <string>
#include <variant>

int main() {
  using var_t = std::variant<const int, const std::string>;
  var_t v;
  var_t v2(v);
}

https://godbolt.org/z/zaov3GxdY

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

* [Bug libstdc++/102913] variant_construct_single should not remove the const qualifier of Up
  2021-10-24 13:18 [Bug libstdc++/102913] New: variant_construct_single should not remove the const qualifier of Up hewillk at gmail dot com
@ 2021-10-24 14:12 ` hewillk at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: hewillk at gmail dot com @ 2021-10-24 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
Dup.

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

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

end of thread, other threads:[~2021-10-24 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 13:18 [Bug libstdc++/102913] New: variant_construct_single should not remove the const qualifier of Up hewillk at gmail dot com
2021-10-24 14:12 ` [Bug libstdc++/102913] " hewillk at gmail dot com

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