diff mbox

[C++] PR 58610

Message ID 53122607.70104@oracle.com
State New
Headers show

Commit Message

Paolo Carlini March 1, 2014, 6:25 p.m. UTC
... in fact, we can also imagine the below clean-up, for another 
DECL_DELETED_FN use and likewise for DECL_DECLARED_CONSTEXPR_P (which 
immediately applies STRIP_TEMPLATE to its argument) uses. Or for Stage 
1, maybe?

Thanks,
Paolo.

//////////////////
2014-03-01  Paolo Carlini  <paolo.carlini@oracle.com>

	* method.c (implicitly_declare_fn): Remove redundant
	DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
	* semantics.c (is_instantiation_of_constexpr): Likewise.
	* error.c (dump_function_decl): Likewise.

Comments

Jason Merrill March 1, 2014, 8:59 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

Index: error.c
===================================================================
--- error.c	(revision 208243)
+++ error.c	(working copy)
@@ -1465,7 +1465,7 @@  dump_function_decl (cxx_pretty_printer *pp, tree t
       else if (DECL_VIRTUAL_P (t))
 	pp_cxx_ws_string (pp, "virtual");
 
-      if (DECL_DECLARED_CONSTEXPR_P (STRIP_TEMPLATE (t)))
+      if (DECL_DECLARED_CONSTEXPR_P (t))
 	pp_cxx_ws_string (pp, "constexpr");
     }
 
Index: method.c
===================================================================
--- method.c	(revision 208243)
+++ method.c	(working copy)
@@ -1645,9 +1645,8 @@  implicitly_declare_fn (special_function_kind kind,
       /* For an inheriting constructor template, just copy these flags from
 	 the inherited constructor template for now.  */
       raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (inherited_ctor));
-      deleted_p = DECL_DELETED_FN (DECL_TEMPLATE_RESULT (inherited_ctor));
-      constexpr_p
-	= DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT (inherited_ctor));
+      deleted_p = DECL_DELETED_FN (inherited_ctor);
+      constexpr_p = DECL_DECLARED_CONSTEXPR_P (inherited_ctor);
     }
   else
     synthesized_method_walk (type, kind, const_p, &raises, &trivial_p,
@@ -1726,8 +1725,7 @@  implicitly_declare_fn (special_function_kind kind,
       TREE_PROTECTED (fn) = TREE_PROTECTED (inherited_ctor);
       /* Copy constexpr from the inherited constructor even if the
 	 inheriting constructor doesn't satisfy the requirements.  */
-      constexpr_p
-	= DECL_DECLARED_CONSTEXPR_P (STRIP_TEMPLATE (inherited_ctor));
+      constexpr_p = DECL_DECLARED_CONSTEXPR_P (inherited_ctor);
     }
   /* Add the "this" parameter.  */
   this_parm = build_this_parm (fn_type, TYPE_UNQUALIFIED);
Index: semantics.c
===================================================================
--- semantics.c	(revision 208243)
+++ semantics.c	(working copy)
@@ -3941,8 +3941,7 @@  static inline bool
 is_instantiation_of_constexpr (tree fun)
 {
   return (DECL_TEMPLOID_INSTANTIATION (fun)
-	  && DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT
-					(DECL_TI_TEMPLATE (fun))));
+	  && DECL_DECLARED_CONSTEXPR_P (DECL_TI_TEMPLATE (fun)));
 }
 
 /* Generate RTL for FN.  */