Implement UDL changes from P0732R2.
authorJason Merrill <jason@redhat.com>
Mon, 5 Nov 2018 07:47:05 +0000 (02:47 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 5 Nov 2018 07:47:05 +0000 (02:47 -0500)
commitb008f16b7a279da845070dce786ea3afd5925364
treefecb35ba45ea46dcb0a2b02194e8b1b54ed0e467
parent4be5c72cf3ea3ee98a97ac2e53d21122ad224b10
Implement UDL changes from P0732R2.

Implementing the UDL changes was pretty straightforward; I simplified
cp_parser_userdef_string_literal using the releasing_vec type from mangle.c.

While looking at this, I realized that the string UDL template taking a
character pack that we implemented for C++14 didn't actually make it into
C++14, so I've added a pedwarn for it and no longer suggest it in the
diagnostic about an invalid UDL template.

* cp-tree.h (struct releasing_vec): Move from mangle.c.
Add get_ref method.
* parser.c (cp_parser_userdef_string_literal): Use it.  Handle
passing the string to a single template parameter of class type.
(cp_parser_template_declaration_after_parameters): Allow it.
Pedwarn about the character pack template that was proposed but not
accepted for C++14, and don't suggest it.

From-SVN: r265790
12 files changed:
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/mangle.c
gcc/cp/parser.c
gcc/testsuite/g++.dg/cpp0x/udlit-overflow.C
gcc/testsuite/g++.dg/cpp1y/pr58708.C
gcc/testsuite/g++.dg/cpp1y/pr59867.C
gcc/testsuite/g++.dg/cpp1y/udlit-char-template-sfinae.C
gcc/testsuite/g++.dg/cpp1y/udlit-char-template-vs-std-literal-operator.C
gcc/testsuite/g++.dg/cpp1y/udlit-char-template.C
gcc/testsuite/g++.dg/cpp1y/udlit-char-template2.C
gcc/testsuite/g++.dg/cpp2a/nontype-class6.C [new file with mode: 0644]