public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99103] New: Initializer-list constructors in CTAD for vector is still wrong
@ 2021-02-15 10:57 oleksandr.koval.dev at gmail dot com
  2021-02-15 19:07 ` [Bug c++/99103] " ppalka at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: oleksandr.koval.dev at gmail dot com @ 2021-02-15 10:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99103
           Summary: Initializer-list constructors in CTAD for vector is
                    still wrong
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: oleksandr.koval.dev at gmail dot com
  Target Milestone: ---

According to P0702R1, initializer-list constructors for T should be ignored
during CTAD if list contains a single element of cv U when U is a
specialization or a child of T. It works for simple things like:

std::vector v{std::vector{1, 2, 3}};
static_assert(std::is_same_v<decltype(v), std::vector<int>>); // fine

But not for this one:

template<typename... Args>
auto make_vector(const Args&... elems){
    return std::vector{elems...};
}
auto v2 = make_vector(std::vector{1,2,3});
static_assert(std::is_same_v<decltype(v2), std::vector<int>>); // fails
static_assert(std::is_same_v<decltype(v2), std::vector<std::vector<int>>>); //
OK

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

end of thread, other threads:[~2021-02-25 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 10:57 [Bug c++/99103] New: Initializer-list constructors in CTAD for vector is still wrong oleksandr.koval.dev at gmail dot com
2021-02-15 19:07 ` [Bug c++/99103] " ppalka at gcc dot gnu.org
2021-02-25 21:39 ` cvs-commit at gcc dot gnu.org
2021-02-25 21:39 ` ppalka 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).