summaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 0b6a83f3445..dfd061aff5c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7053,7 +7053,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
otherwise the call should go through the dispatcher. */
if (DECL_FUNCTION_VERSIONED (fn)
- && !targetm.target_option.can_inline_p (current_function_decl, fn))
+ && (current_function_decl == NULL
+ || !targetm.target_option.can_inline_p (current_function_decl, fn)))
{
fn = get_function_version_dispatcher (fn);
if (fn == NULL)