diff options
author | Jason Merrill <jason@redhat.com> | 2020-01-13 18:13:46 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-01-13 20:30:18 -0500 |
commit | edabbec31e3bfc9a9757f80c8610706ed00e5a1a (patch) | |
tree | 065b4bf6ed94b2de06417a2db1aa6e5cdf9e4111 | |
parent | 8ca4435f431f9b8049ebf102b5659f2d3e7be198 (diff) | |
download | gcc-edabbec31e3bfc9a9757f80c8610706ed00e5a1a.zip gcc-edabbec31e3bfc9a9757f80c8610706ed00e5a1a.tar.gz gcc-edabbec31e3bfc9a9757f80c8610706ed00e5a1a.tar.bz2 |
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.
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/except.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/concepts/fn-concept3.C | 6 |
3 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 59646c7..4729e3d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 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. * pt.c (struct find_template_parameter_info): Add ctx_parms. (any_template_parm_r): Handle TEMPLATE_DECL. diff --git a/gcc/cp/except.c b/gcc/cp/except.c index e073bd4..55b4b6a 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -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... */ tree fn = cp_get_callee (t); + if (concept_check_p (fn)) + return NULL_TREE; tree type = TREE_TYPE (fn); gcc_assert (INDIRECT_TYPE_P (type)); type = TREE_TYPE (type); diff --git a/gcc/testsuite/g++.dg/concepts/fn-concept3.C b/gcc/testsuite/g++.dg/concepts/fn-concept3.C new file mode 100644 index 0000000..ecb7f6b --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/fn-concept3.C @@ -0,0 +1,6 @@ +// 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"); |