This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implement N4051 - Allow typename in a template template parameter


On 07/23/2014 06:05 AM, Jason Merrill wrote:
On 07/22/2014 01:53 PM, Ed Smith-Rowland wrote:
+    if (cxx_dialect < cxx1z)
+      {
+        /* Look for the `class' keyword.  */
+        cp_parser_require_keyword (parser, RID_CLASS, RT_CLASS);
+      }
+    else
+      {
+        /* Look for the `class' or 'typename' keywords.  */
+ enum tag_types tag_type = cp_parser_type_parameter_key (parser);
+        if (tag_type == none_type)
+          return error_mark_node;
+      }

Let's encapsulate this in cp_parser_type_parameter_key. And also accept 'typename' in lower dialects with a pedwarn.

Jason


OK,

Here is the latest.  I did the rearranging.
g++ now accepts template<template<typename> typename X> from g++98 on with pedwarn. I also upped the test support lib to support c++1z better (this for testing pedwarn for version < cxx1z).

Bootstraps and tests clean on x86_64-linux.

OK?

Attachment: CL_typename_template_template_2
Description: Text document

Attachment: patch_typename_template_template_5
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]