Patchwork [3/4,lambda] Address review comments.

login
register
mail settings
Submitter Adam Butcher
Date Aug. 1, 2013, 12:25 p.m.
Message ID <1375359930-12871-4-git-send-email-adam@jessamine.co.uk>
Download mbox | patch
Permalink /patch/264423/
State New
Headers show

Comments

Adam Butcher - Aug. 1, 2013, 12:25 p.m.
---
 gcc/cp/cp-tree.h | 2 +-
 gcc/cp/decl.c    | 3 ++-
 gcc/cp/lambda.c  | 2 +-
 gcc/cp/parser.c  | 6 ++----
 gcc/cp/pt.c      | 4 ++--
 5 files changed, 8 insertions(+), 9 deletions(-)
Gabriel Dos Reis - Aug. 3, 2013, 1:39 p.m.
On Thu, Aug 1, 2013 at 7:25 AM, Adam Butcher <adam@jessamine.co.uk> wrote:
> ---
>  gcc/cp/cp-tree.h | 2 +-
>  gcc/cp/decl.c    | 3 ++-
>  gcc/cp/lambda.c  | 2 +-
>  gcc/cp/parser.c  | 6 ++----
>  gcc/cp/pt.c      | 4 ++--
>  5 files changed, 8 insertions(+), 9 deletions(-)

When submitting patches, you also need to add ChangeLogs:

  http://www.gnu.org/prep/standards/html_node/Change-Logs.html
  http://gcc.gnu.org/wiki/ChangeLog

-- Gaby
Adam Butcher - Aug. 3, 2013, 1:51 p.m.
On 03.08.2013 14:39, Gabriel Dos Reis wrote:
> On Thu, Aug 1, 2013 at 7:25 AM, Adam Butcher <adam@jessamine.co.uk> 
> wrote:
>> ---
>>  gcc/cp/cp-tree.h | 2 +-
>>  gcc/cp/decl.c    | 3 ++-
>>  gcc/cp/lambda.c  | 2 +-
>>  gcc/cp/parser.c  | 6 ++----
>>  gcc/cp/pt.c      | 4 ++--
>>  5 files changed, 8 insertions(+), 9 deletions(-)
>
> When submitting patches, you also need to add ChangeLogs:
>
>   http://www.gnu.org/prep/standards/html_node/Change-Logs.html
>   http://gcc.gnu.org/wiki/ChangeLog
>
These patches were intended as incremental updates to an ongoing review

   http://gcc.gnu.org/ml/gcc-patches/2013-07/threads.html#00755
   http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00130.html

I intend to submit a clean set with appropriate changelog once Jason is 
happy with them.  I wasn't intending these to be committed as is.

Cheers,
Adam

Patch

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 64ff4e3..17bb8b9 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1089,7 +1089,7 @@  struct GTY(()) saved_scope {
 #define processing_specialization scope_chain->x_processing_specialization
 #define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation
 
-/* Nonzero if the function being declared was made a template due to it's
+/* Nonzero if the function being declared was made a template due to its
    parameter list containing generic type specifiers (`auto' or concept
    identifiers) rather than an explicit template parameter list.  */
 
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 98e8dc9..72332ba 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10331,7 +10331,8 @@  grokdeclarator (const cp_declarator *declarator,
 
       if (type_uses_auto (type) && cxx_dialect < cxx1y)
 	{
-	  error ("parameter declared %<auto%> (unsupported prior to C++1y)");
+	  error ("use of %<auto%> in parameter declaration only available with "
+		 "-std=c++1y or -std=gnu++1y");
 	  type = error_mark_node;
 	}
 
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index cf662bb..015e6d1 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -776,7 +776,7 @@  maybe_add_lambda_conv_op (tree type)
   if (generic_lambda_p)
     {
       /* Construct the dependent member call for the static member function
-	 '_FUN' and remove 'auto' from it's return type to allow for simple
+	 '_FUN' and remove 'auto' from its return type to allow for simple
 	 implementation of the conversion operator.  */
 
       tree instance = build_nop (type, null_pointer_node);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 45f5d7e..5169f66 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8821,9 +8821,8 @@  cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
 
       if (cxx_dialect < cxx1y)
 	cp_parser_error (parser,
-			 "Generic lambdas are only supported in C++1y mode.");
-
-      push_deferring_access_checks (dk_deferred);
+			 "generic lambdas are only available with "
+			 "-std=c++1y or -std=gnu++1y");
 
       template_param_list = cp_parser_template_parameter_list (parser);
 
@@ -8928,7 +8927,6 @@  cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
 	DECL_NAME (DECL_ARGUMENTS (fco)) = get_identifier ("__closure");
 	if (template_param_list)
 	  {
-	    pop_deferring_access_checks ();
 	    fco = finish_member_template_decl (fco);
 	    finish_template_decl (template_param_list);
 	    --parser->num_template_parameter_lists;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 6e209f8..a7baaba 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -21025,7 +21025,7 @@  is_auto (const_tree type)
 }
 
 /* Returns the first tree within T that is directly matched by PRED.  T may be a
-   type or PARM_DECL and is incrementally decomposed toward it's type-specifier
+   type or PARM_DECL and is incrementally decomposed toward its type-specifier
    until a match is found.  NULL_TREE is returned if PRED does not match any
    part of T.
 
@@ -21341,7 +21341,7 @@  add_implicit_template_parms (size_t count, tree parameters)
    template has no explicit template parameter list so has not been through the
    normal template head and tail processing.  add_implicit_template_parms tries
    to do the head; this tries to do the tail.  MEMBER_DECL_OPT should be
-   provided if the declaration is a class member such that it's template
+   provided if the declaration is a class member such that its template
    declaration can be completed.  If MEMBER_DECL_OPT is provided the finished
    form is returned.  Otherwise NULL_TREE is returned. */