c++: Aggregate CTAD and string constants.
authorJason Merrill <jason@redhat.com>
Wed, 8 Jul 2020 05:11:44 +0000 (01:11 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 20 Jul 2020 21:53:43 +0000 (17:53 -0400)
commitd0ffe9d5dc83092e6de996483c4c08b439a316c0
tree57564f18d4d629bfd20083c216e2e3f1997a514a
parent87891d5eafe8d1de90b9d9b056eca81c508d1c77
c++: Aggregate CTAD and string constants.

In CWG discussion, it was suggested that deduction from a string literal
should be to reference-to-const, so that we deduce 'char' rather than 'const
char' for T.

gcc/cp/ChangeLog:

* pt.c (collect_ctor_idx_types): Add 'const' when deducing from
a string constant.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/class-deduction-aggr7.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr7.C [new file with mode: 0644]