bool
constraints_satisfied_p (tree t)
{
+ if (!flag_concepts)
+ return true;
+
return constraint_satisfaction_value (t, tf_none) == boolean_true_node;
}
bool
constraints_satisfied_p (tree t, tree args)
{
+ if (!flag_concepts)
+ return true;
+
return constraint_satisfaction_value (t, args, tf_none) == boolean_true_node;
}
[temp.explicit]
- The explicit instantiation of a class template specialization
- implies the instantiation of all of its members not
- previously explicitly specialized in the translation unit
- containing the explicit instantiation.
-
- Of course, we can't instantiate member template classes, since we
- don't have any arguments for them. Note that the standard is
- unclear on whether the instantiation of the members are
- *explicit* instantiations or not. However, the most natural
- interpretation is that it should be an explicit
- instantiation. */
+ An explicit instantiation that names a class template
+ specialization is also an explicit instantiation of the same
+ kind (declaration or definition) of each of its members (not
+ including members inherited from base classes and members
+ that are templates) that has not been previously explicitly
+ specialized in the translation unit containing the explicit
+ instantiation, provided that the associated constraints, if
+ any, of that member are satisfied by the template arguments
+ of the explicit instantiation. */
for (tree fld = TYPE_FIELDS (t); fld; fld = DECL_CHAIN (fld))
if ((VAR_P (fld)
|| (TREE_CODE (fld) == FUNCTION_DECL
&& !static_p
&& user_provided_p (fld)))
- && DECL_TEMPLATE_INSTANTIATION (fld))
+ && DECL_TEMPLATE_INSTANTIATION (fld)
+ && constraints_satisfied_p (fld))
{
mark_decl_instantiated (fld, extern_p);
if (! extern_p)