Commit 4fd602a1 by Paolo Carlini Committed by Paolo Carlini

re PR c++/58607 ([c++11] ICE with undeclared variable in constexpr)

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

	PR c++/58607
	* semantics.c (check_constexpr_ctor_body): Check for BIND_EXPR_VARS.

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

	PR c++/58607
	* g++.dg/cpp0x/constexpr-ice9.C: New.

From-SVN: r205364
parent 807b7031
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58607
* semantics.c (check_constexpr_ctor_body): Check for BIND_EXPR_VARS.
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58810
* decl.c (grokdeclarator): Don't handle qualified free functions here,
leave the diagnostic to grokfndecl.
......
......@@ -7596,6 +7596,11 @@ check_constexpr_ctor_body (tree last, tree list)
break;
if (TREE_CODE (t) == BIND_EXPR)
{
if (BIND_EXPR_VARS (t))
{
ok = false;
break;
}
if (!check_constexpr_ctor_body (last, BIND_EXPR_BODY (t)))
return false;
else
......
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58607
* g++.dg/cpp0x/constexpr-ice9.C: New.
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58810
* g++.dg/other/cv_func3.C: New.
* g++.dg/other/cv_func.C: Adjust.
......
// PR c++/58607
// { dg-do compile { target c++11 } }
struct A
{
constexpr A() { i; } // { dg-error "declared|empty body" }
};
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