Commit edabbec3 by Jason Merrill

PR c++/92746 - ICE with noexcept of function concept check.

Another place that needs to specially handle Concepts TS function-style
concepts.

	* except.c (check_noexcept_r): Handle concept-check.
parent 8ca4435f
2020-01-13 Jason Merrill <jason@redhat.com> 2020-01-13 Jason Merrill <jason@redhat.com>
PR c++/92746 - ICE with noexcept of function concept check.
* except.c (check_noexcept_r): Handle concept-check.
PR c++/92582 - ICE with member template as requirement. PR c++/92582 - ICE with member template as requirement.
* pt.c (struct find_template_parameter_info): Add ctx_parms. * pt.c (struct find_template_parameter_info): Add ctx_parms.
(any_template_parm_r): Handle TEMPLATE_DECL. (any_template_parm_r): Handle TEMPLATE_DECL.
......
...@@ -1117,6 +1117,8 @@ check_noexcept_r (tree *tp, int * /*walk_subtrees*/, void * /*data*/) ...@@ -1117,6 +1117,8 @@ check_noexcept_r (tree *tp, int * /*walk_subtrees*/, void * /*data*/)
We could use TREE_NOTHROW (t) for !TREE_PUBLIC fns, though... */ We could use TREE_NOTHROW (t) for !TREE_PUBLIC fns, though... */
tree fn = cp_get_callee (t); tree fn = cp_get_callee (t);
if (concept_check_p (fn))
return NULL_TREE;
tree type = TREE_TYPE (fn); tree type = TREE_TYPE (fn);
gcc_assert (INDIRECT_TYPE_P (type)); gcc_assert (INDIRECT_TYPE_P (type));
type = TREE_TYPE (type); type = TREE_TYPE (type);
......
// PR c++/92746
// { dg-do compile { target c++17_only } }
// { dg-options "-fconcepts" }
template<typename T> concept bool C3() { return true; }
static_assert(noexcept(C3<int>()), "function concept should be treated as if noexcept(true) specified");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment