public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/93107] unable to deduce initializer_list<auto> from function template
[not found] <bug-93107-4@http.gcc.gnu.org/bugzilla/>
@ 2020-10-16 2:03 ` mpolacek at gcc dot gnu.org
2020-10-29 20:12 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-16 2:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93107
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Status|NEW |ASSIGNED
CC| |mpolacek at gcc dot gnu.org
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like a failure to call resolve_nondeduced_context. I have a patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/93107] unable to deduce initializer_list<auto> from function template
[not found] <bug-93107-4@http.gcc.gnu.org/bugzilla/>
2020-10-16 2:03 ` [Bug c++/93107] unable to deduce initializer_list<auto> from function template mpolacek at gcc dot gnu.org
@ 2020-10-29 20:12 ` cvs-commit at gcc dot gnu.org
2020-10-29 20:13 ` mpolacek at gcc dot gnu.org
2023-05-08 13:03 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-29 20:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93107
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:6fb7e3c29188ab7cde0b963957caf6182536c77d
commit r11-4547-g6fb7e3c29188ab7cde0b963957caf6182536c77d
Author: Marek Polacek <polacek@redhat.com>
Date: Fri Oct 16 11:00:12 2020 -0400
c++: Deducing type from initializer_list<auto> [PR93107]
In this testcase we weren't able to deduce b's type:
template<typename T> void Task() { }
auto b = { &Task<int> };
because resolve_nondeduced_context doesn't iterate on the {}'s elements.
So make sure to look into {} too. We don't need to handle nested {}
here.
We could either tweak resolve_nondeduced_context to handle CONSTRUCTORs
or add a _ctor version, but then resolve_nondeduced_context_or_error
would need some changes too -- it'd have to check the result of a call
to r_n_c for each element.
gcc/cp/ChangeLog:
PR c++/93107
* pt.c (do_auto_deduction): Call resolve_nondeduced_context for
the elements of a { } list.
gcc/testsuite/ChangeLog:
PR c++/93107
* g++.dg/cpp0x/initlist-deduce3.C: New test.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/93107] unable to deduce initializer_list<auto> from function template
[not found] <bug-93107-4@http.gcc.gnu.org/bugzilla/>
2020-10-16 2:03 ` [Bug c++/93107] unable to deduce initializer_list<auto> from function template mpolacek at gcc dot gnu.org
2020-10-29 20:12 ` cvs-commit at gcc dot gnu.org
@ 2020-10-29 20:13 ` mpolacek at gcc dot gnu.org
2023-05-08 13:03 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-29 20:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93107
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed (GCC 11), thanks for the report.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/93107] unable to deduce initializer_list<auto> from function template
[not found] <bug-93107-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2020-10-29 20:13 ` mpolacek at gcc dot gnu.org
@ 2023-05-08 13:03 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-08 13:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93107
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:06ef1583d68169d1a002f5e86189462bb748963c
commit r14-578-g06ef1583d68169d1a002f5e86189462bb748963c
Author: Patrick Palka <ppalka@redhat.com>
Date: Mon May 8 09:03:35 2023 -0400
c++: list CTAD and resolve_nondeduced_context [PR106214]
This extends the PR93107 fix, which made us do resolve_nondeduced_context
on the elements of an initializer list during auto deduction, to happen for
CTAD as well.
PR c++/106214
PR c++/93107
gcc/cp/ChangeLog:
* pt.cc (do_auto_deduction): Move up resolve_nondeduced_context
calls to happen before do_class_deduction. Add some
error_mark_node tests.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1z/class-deduction114.C: New test.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-08 13:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-93107-4@http.gcc.gnu.org/bugzilla/>
2020-10-16 2:03 ` [Bug c++/93107] unable to deduce initializer_list<auto> from function template mpolacek at gcc dot gnu.org
2020-10-29 20:12 ` cvs-commit at gcc dot gnu.org
2020-10-29 20:13 ` mpolacek at gcc dot gnu.org
2023-05-08 13:03 ` cvs-commit 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).