summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 508570bdb04..94738bd8f78 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -8093,8 +8093,9 @@ resolve_address_of_overloaded_function (tree target_type,
continue;
/* In C++17 we need the noexcept-qualifier to compare types. */
- if (flag_noexcept_type)
- maybe_instantiate_noexcept (fn);
+ if (flag_noexcept_type
+ && !maybe_instantiate_noexcept (fn, complain))
+ continue;
/* See if there's a match. */
tree fntype = static_fn_type (fn);
@@ -8176,7 +8177,7 @@ resolve_address_of_overloaded_function (tree target_type,
/* In C++17 we need the noexcept-qualifier to compare types. */
if (flag_noexcept_type)
- maybe_instantiate_noexcept (instantiation);
+ maybe_instantiate_noexcept (instantiation, complain);
/* See if there's a match. */
tree fntype = static_fn_type (instantiation);