diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c45ddbec7bd..cbae6c43978 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-11-27 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/58647 + * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]): + Handle function COMPONENT_REFs. + 2013-11-27 Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e72a9c2f169..bc10f1de39b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -9603,6 +9603,16 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t, break; case COMPONENT_REF: + if (is_overloaded_fn (t)) + { + /* We can only get here in checking mode via + 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); + *non_constant_p = true; + return t; + } r = cxx_eval_component_reference (call, t, allow_non_constant, addr, non_constant_p, overflow_p); break; |