diff options
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 8a7dd7d5e62..199084a6008 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -7138,6 +7138,7 @@ maybe_constant_value (tree t) tree r; if (type_dependent_expression_p (t) + || type_unknown_p (t) || !potential_constant_expression (t) || value_dependent_expression_p (t)) return t; @@ -7727,6 +7728,14 @@ potential_constant_expression (tree t) return potential_constant_expression_1 (t, false, tf_none); } +/* As above, but require a constant rvalue. */ + +bool +potential_rvalue_constant_expression (tree t) +{ + return potential_constant_expression_1 (t, true, tf_none); +} + /* Like above, but complain about non-constant expressions. */ bool @@ -7734,6 +7743,14 @@ require_potential_constant_expression (tree t) { return potential_constant_expression_1 (t, false, tf_warning_or_error); } + +/* Cross product of the above. */ + +bool +require_potential_rvalue_constant_expression (tree t) +{ + return potential_constant_expression_1 (t, true, tf_warning_or_error); +} /* Constructor for a lambda expression. */ |