+ /* Check defaulted declarations here so we have cant_have_const_ctor
+ and don't need to worry about clones. */
+ for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
+ if (DECL_DEFAULTED_IN_CLASS_P (fn))
+ {
+ int copy = copy_fn_p (fn);
+ if (copy > 0)
+ {
+ bool imp_const_p
+ = (DECL_CONSTRUCTOR_P (fn) ? !cant_have_const_ctor
+ : !no_const_asn_ref);
+ bool fn_const_p = (copy == 2);
+
+ if (fn_const_p && !imp_const_p)
+ /* If the function is defaulted outside the class, we just
+ give the synthesis error. */
+ error ("%q+D declared to take const reference, but implicit "
+ "declaration would take non-const", fn);
+ else if (imp_const_p && !fn_const_p)
+ error ("%q+D declared to take non-const reference cannot be "
+ "defaulted in the class body", fn);
+ }
+ defaulted_late_check (fn);
+ }
+
+ if (LAMBDA_TYPE_P (t))
+ {
+ /* "The closure type associated with a lambda-expression has a deleted
+ default constructor and a deleted copy assignment operator." */
+ TYPE_NEEDS_CONSTRUCTING (t) = 1;
+ TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 0;
+ CLASSTYPE_LAZY_DEFAULT_CTOR (t) = 0;
+ TYPE_HAS_ASSIGN_REF (t) = 0;
+ CLASSTYPE_LAZY_ASSIGNMENT_OP (t) = 0;
+
+ /* "This class type is not an aggregate." */
+ CLASSTYPE_NON_AGGREGATE (t) = 1;
+ }
+