PR c++/81853 - using-directive and constexpr.

* constexpr.c (cxx_eval_constant_expression): Handle USING_STMT.

From-SVN: r257762
This commit is contained in:
Jason Merrill 2018-02-16 16:02:55 -05:00 committed by Jason Merrill
parent 6f58bc5825
commit 3664e317b8
3 changed files with 20 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2018-02-16 Jason Merrill <jason@redhat.com>
PR c++/81853 - using-directive and constexpr.
* constexpr.c (cxx_eval_constant_expression): Handle USING_STMT.
PR c++/84420 - ICE with structured binding in lambda.
* lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P.

View File

@ -4726,6 +4726,10 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
jump_target);
break;
case USING_STMT:
r = void_node;
break;
default:
if (STATEMENT_CODE_P (TREE_CODE (t)))
{

View File

@ -0,0 +1,13 @@
// PR c++/81853
// { dg-do compile { target c++11 } }
// { dg-options "" }
namespace N {
enum { i };
}
int g ()
{
constexpr int j = ({ using namespace N; i; });
return j;
}