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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 9fb4fc0..eb1c44e 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7380,7 +7380,8 @@ ensure_literal_type_for_constexpr_object (tree decl)
if (VAR_P (decl) && DECL_DECLARED_CONSTEXPR_P (decl)
&& !processing_template_decl)
{
- if (CLASS_TYPE_P (type) && !COMPLETE_TYPE_P (complete_type (type)))
+ tree stype = strip_array_types (type);
+ if (CLASS_TYPE_P (stype) && !COMPLETE_TYPE_P (complete_type (stype)))
/* Don't complain here, we'll complain about incompleteness
when we try to initialize the variable. */;
else if (!literal_type_p (type))
@@ -9676,7 +9677,7 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t,
build_non_dependent_expr, because any expression that
calls or takes the address of the function will have
pulled a FUNCTION_DECL out of the COMPONENT_REF. */
- gcc_checking_assert (allow_non_constant);
+ gcc_checking_assert (allow_non_constant || errorcount);
*non_constant_p = true;
return t;
}