+2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/70621
+ * decl.c (start_decl): Early return error_mark_node if duplicate_decls
+ returns it; avoid misleading error message.
+
2017-09-12 Nathan Sidwell <nathan@acm.org>
Kill CLASSTYPE_SORTED_FIELDS.
about this situation, and so we check here. */
if (initialized && DECL_INITIALIZED_IN_CLASS_P (field))
error ("duplicate initialization of %qD", decl);
- if (duplicate_decls (decl, field, /*newdecl_is_friend=*/false))
+ field = duplicate_decls (decl, field,
+ /*newdecl_is_friend=*/false);
+ if (field == error_mark_node)
+ return error_mark_node;
+ else if (field)
decl = field;
- if (decl_spec_seq_has_spec_p (declspecs, ds_constexpr)
- && !DECL_DECLARED_CONSTEXPR_P (field))
- error ("%qD declared %<constexpr%> outside its class", field);
}
}
else