* constraint.cc (strictly_subsumes): New.
* cp-tree.h: Declare it.
* pt.c (process_partial_specialization): Use it instead of
subsumes_constraints.
(maybe_new_partial_specialization): Do compare null constraints.
* search.c (lookup_member): Handle currently_open_class returning null.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231350
138bc75d-0d04-0410-961f-
82ee72b054a4
-2015-12-05 Jason Merrill <jason@redhat.com>
+2015-12-06 Jason Merrill <jason@redhat.com>
+
+ * constraint.cc (strictly_subsumes): New.
+ * cp-tree.h: Declare it.
+ * pt.c (process_partial_specialization): Use it instead of
+ subsumes_constraints.
+ (maybe_new_partial_specialization): Do compare null constraints.
+ * search.c (lookup_member): Handle currently_open_class returning null.
PR c++/68597, fix auto9.C and auto-neg1.C with -std=c++1z.
* decl.c (check_tag_decl): Use ds_type_spec in auto diagnostic.
return subsumes (a, b);
}
+/* Returns true when the the constraints in A subsume those in B, but
+ the constraints in B do not subsume the constraints in A. */
+
+bool
+strictly_subsumes (tree a, tree b)
+{
+ return subsumes (a, b) && !subsumes (b, a);
+}
+
/* Determines which of the declarations, A or B, is more constrained.
That is, which declaration's constraints subsume but are not subsumed
by the other's?
extern bool equivalent_constraints (tree, tree);
extern bool equivalently_constrained (tree, tree);
extern bool subsumes_constraints (tree, tree);
+extern bool strictly_subsumes (tree, tree);
extern int more_constrained (tree, tree);
extern void diagnose_constraints (location_t, tree, tree);
tree type_constr = current_template_constraints ();
if (type == TREE_TYPE (tmpl))
- if (tree main_constr = get_constraints (tmpl))
+ {
+ tree main_constr = get_constraints (tmpl);
if (equivalent_constraints (type_constr, main_constr))
return NULL_TREE;
+ }
// Also, if there's a pre-existing specialization with matching
// constraints, then this also isn't new.
= TI_ARGS (get_template_info (DECL_TEMPLATE_RESULT (maintmpl)));
if (comp_template_args (inner_args, INNERMOST_TEMPLATE_ARGS (main_args))
&& (!flag_concepts
- || !subsumes_constraints (current_template_constraints (),
- get_constraints (maintmpl))))
+ || !strictly_subsumes (current_template_constraints (),
+ get_constraints (maintmpl))))
{
if (!flag_concepts)
error ("partial specialization %q+D does not specialize "
/* Make sure we're looking for a member of the current instantiation in the
right partial specialization. */
if (flag_concepts && dependent_type_p (type))
- type = currently_open_class (type);
+ if (tree t = currently_open_class (type))
+ type = t;
if (!basetype_path)
basetype_path = TYPE_BINFO (type);