Commit 6f831b6d by Paolo Carlini Committed by Paolo Carlini

re PR c++/58647 (ICE with function pointer)

/cp
2013-11-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58647
	* semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
	Handle function COMPONENT_REFs.

/testsuite
2013-11-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58647
	* g++.dg/parse/crash66.C: New.

From-SVN: r205449
parent 2e252084
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> 2013-11-27 Aldy Hernandez <aldyh@redhat.com>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>
......
...@@ -9603,6 +9603,16 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t, ...@@ -9603,6 +9603,16 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t,
break; break;
case COMPONENT_REF: 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, r = cxx_eval_component_reference (call, t, allow_non_constant, addr,
non_constant_p, overflow_p); non_constant_p, overflow_p);
break; break;
......
2013-11-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58647
* g++.dg/parse/crash66.C: New.
2013-11-27 Kenneth Zadeck <zadeck@naturalbridge.com> 2013-11-27 Kenneth Zadeck <zadeck@naturalbridge.com>
* gcc.dg/c90-const-expr-8.c: Look for overflow on INT_MIN % -1. * gcc.dg/c90-const-expr-8.c: Look for overflow on INT_MIN % -1.
......
// PR c++/58647
struct A
{
static void foo();
};
template<typename> void bar()
{
A().foo;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment