summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-11-05 02:47:02 -0500
committerJason Merrill <jason@gcc.gnu.org>2018-11-05 02:47:02 -0500
commit4be5c72cf3ea3ee98a97ac2e53d21122ad224b10 (patch)
tree074d1e84a17c188274a39b3a002dc5c265626a8e /include
parent5dab8b11c41fe72ea606c38884f7730bd2aeafdc (diff)
Implement P0732R2, class types in non-type template parameters.
There is one significant piece of this that is not implemented yet: the reliance on defaulted operator<=>, which someone else has been working on. So, for the moment those lines are commented out of the testcases. One tricky bit was treating template parameters of classtype as const lvalues without making their decltype const; for this I used a VIEW_CONVERT_EXPR wrapper, which previously could only appear in templates as location wrappers. The user-defined literal parts of P0732R2 are in the next patch. gcc/cp/ * error.c (dump_simple_decl): Look through a template parm object. * mangle.c (write_template_arg): Likewise. (mangle_template_parm_object): New. * pt.c (template_parm_object_p, get_template_parm_object): New. (invalid_tparm_referent_p): Factor from convert_nontype_argument. (convert_nontype_argument, invalid_nontype_parm_type_p): Handle class-type template arguments. * tree.c (lvalue_kind): Likewise. gcc/c-family/ * c-cppbuiltin.c (c_cpp_builtins): Add __cpp_nontype_template_parameter_class. libiberty/ * cp-demangle.c (d_dump, d_make_comp, d_count_templates_scopes) (d_print_comp_inner): Handle DEMANGLE_COMPONENT_TPARM_OBJ. (d_special_name): Handle TA. (d_expresion_1): Fix demangling of brace-enclosed initializer list. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_TPARM_OBJ. From-SVN: r265789
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/demangle.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 4584f7cb8af..19f515d59b3 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-19 Jason Merrill <jason@redhat.com>
+
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_TPARM_OBJ.
+
2018-10-29 David Malcolm <dmalcolm@redhat.com>
* unique-ptr.h (gnu::move): Generalize so it applies to all
diff --git a/include/demangle.h b/include/demangle.h
index b8d57cf2951..4f920f2b7f5 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -392,6 +392,9 @@ enum demangle_component_type
template argument, and the right subtree is either NULL or
another TEMPLATE_ARGLIST node. */
DEMANGLE_COMPONENT_TEMPLATE_ARGLIST,
+ /* A template parameter object (C++20). The left subtree is the
+ corresponding template argument. */
+ DEMANGLE_COMPONENT_TPARM_OBJ,
/* An initializer list. The left subtree is either an explicit type or
NULL, and the right subtree is a DEMANGLE_COMPONENT_ARGLIST. */
DEMANGLE_COMPONENT_INITIALIZER_LIST,