public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101509] New: Rejects valid construction call with type inference
@ 2021-07-19 12:35 gareth@ignition-web.co.uk
  2021-07-19 12:41 ` [Bug c++/101509] " gareth@ignition-web.co.uk
  2021-07-19 12:49 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: gareth@ignition-web.co.uk @ 2021-07-19 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101509
           Summary: Rejects valid construction call with type inference
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gareth@ignition-web.co.uk
  Target Milestone: ---

template <typename T>
struct S { S(T); };

struct my_type{ my_type(S<int>); };

void foo(S<int>);

void test()
{
    my_type(S(1)); // no issue here
    my_type(S{1}); // no issue here
    auto tmp1 = my_type(S(1)); // no issue here
    auto tmp2 = my_type(S{1}); // no issue here
    foo(S(1)); // no issue here
    foo(S{1}); // no issue here
    my_type tmp3(S(1)); // no issue here
    my_type tmp4(S{1}); // GCC error
    my_type tmp5((S{1})); // no issue here
}

https://godbolt.org/z/jb68o46fP

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

* [Bug c++/101509] Rejects valid construction call with type inference
  2021-07-19 12:35 [Bug c++/101509] New: Rejects valid construction call with type inference gareth@ignition-web.co.uk
@ 2021-07-19 12:41 ` gareth@ignition-web.co.uk
  2021-07-19 12:49 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: gareth@ignition-web.co.uk @ 2021-07-19 12:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Gareth Lloyd <gareth@ignition-web.co.uk> ---
This was originally discovered where `S` was `std::vector` and was constructed
with an initializer_list

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

* [Bug c++/101509] Rejects valid construction call with type inference
  2021-07-19 12:35 [Bug c++/101509] New: Rejects valid construction call with type inference gareth@ignition-web.co.uk
  2021-07-19 12:41 ` [Bug c++/101509] " gareth@ignition-web.co.uk
@ 2021-07-19 12:49 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-07-19 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like a dup.

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

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

end of thread, other threads:[~2021-07-19 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 12:35 [Bug c++/101509] New: Rejects valid construction call with type inference gareth@ignition-web.co.uk
2021-07-19 12:41 ` [Bug c++/101509] " gareth@ignition-web.co.uk
2021-07-19 12:49 ` mpolacek 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).