diff options
| author | Marek Polacek <polacek@redhat.com> | 2020-10-16 11:00:12 -0400 |
|---|---|---|
| committer | Marek Polacek <polacek@redhat.com> | 2020-10-29 15:50:52 -0400 |
| commit | 6fb7e3c29188ab7cde0b963957caf6182536c77d (patch) | |
| tree | 919de9b3602f3975a2f28e0e6bb7c1a5a73aa003 /gcc/c | |
| parent | 79991e2348a864ace6ea2bf108a7502862f1129f (diff) | |
| download | gcc-6fb7e3c29188ab7cde0b963957caf6182536c77d.zip gcc-6fb7e3c29188ab7cde0b963957caf6182536c77d.tar.gz gcc-6fb7e3c29188ab7cde0b963957caf6182536c77d.tar.bz2 | |
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.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions
