In working on PR66443, I encountered a few nits. Fixed thusly:
1) a misaligned } in init.c
2) process_subob_fn used goto...label, when regular if {return} works fine. (I
guess the control flow got simplified at some point)
3) implicitly_declare_fn repeats a lambda deleted fn check that
synthesized_method_walk has already done.
The last one was the most suspicious, I checked that constexpr_p and deleted_p
already had the expected values when that if triggered, and that tests actually
got there. bootstrap and testing showed the check redundant.
Committed to trunk.
nathan
2016-09-26 Nathan Sidwell <nat...@acm.org>
* init.c (expand_default_init): Fix } indentation.
* method.c (process_subob_fn): Simplify control structure to
remove gotos.
(implicitly_declare_fn): Remove duplicated lambda ctor check.
Index: init.c
===================================================================
--- init.c (revision 240488)
+++ init.c (working copy)
@@ -1747,7 +1747,7 @@ expand_default_init (tree binfo, tree tr
ctor_name = base_ctor_identifier;
rval = build_special_member_call (exp, ctor_name, &parms, binfo, flags,
complain);
- }
+ }
if (parms != NULL)
release_tree_vector (parms);
Index: method.c
===================================================================
--- method.c (revision 240488)
+++ method.c (working copy)
@@ -1129,7 +1129,11 @@ process_subob_fn (tree fn, tree *spec_p,
bool diag, tree arg, bool dtor_from_ctor = false)
{
if (!fn || fn == error_mark_node)
- goto bad;
+ {
+ if (deleted_p)
+ *deleted_p = true;
+ return;
+ }
if (spec_p)
{
@@ -1162,12 +1166,6 @@ process_subob_fn (tree fn, tree *spec_p,
explain_invalid_constexpr_fn (fn);
}
}
-
- return;
-
- bad:
- if (deleted_p)
- *deleted_p = true;
}
/* Subroutine of synthesized_method_walk to allow recursion into anonymous
@@ -1931,12 +1929,6 @@ implicitly_declare_fn (special_function_
DECL_DEFAULTED_FN (fn) = 1;
if (cxx_dialect >= cxx11)
{
- /* "The closure type associated with a lambda-expression has a deleted
- default constructor and a deleted copy assignment operator." */
- if ((kind == sfk_constructor
- || kind == sfk_copy_assignment)
- && LAMBDA_TYPE_P (type))
- deleted_p = true;
DECL_DELETED_FN (fn) = deleted_p;
DECL_DECLARED_CONSTEXPR_P (fn) = constexpr_p;
}