aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index a6d941b..c87764d 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3949,13 +3949,16 @@ emit_associated_thunks (tree fn)
}
/* Returns true iff FUN is an instantiation of a constexpr function
- template. */
+ template or a defaulted constexpr function. */
static inline bool
is_instantiation_of_constexpr (tree fun)
{
- return (DECL_TEMPLOID_INSTANTIATION (fun)
- && DECL_DECLARED_CONSTEXPR_P (DECL_TI_TEMPLATE (fun)));
+ return ((DECL_TEMPLOID_INSTANTIATION (fun)
+ && DECL_DECLARED_CONSTEXPR_P (DECL_TI_TEMPLATE (fun)))
+ || (DECL_DEFAULTED_FN (fun)
+ && DECL_DECLARED_CONSTEXPR_P (fun)));
+
}
/* Generate RTL for FN. */
@@ -8048,7 +8051,7 @@ explain_invalid_constexpr_fn (tree fun)
if (is_valid_constexpr_fn (fun, true))
{
/* Then if it's OK, the body. */
- if (DECL_DEFAULTED_FN (fun))
+ if (!DECL_DECLARED_CONSTEXPR_P (fun))
explain_implicit_non_constexpr (fun);
else
{