PR c++/81853 - using-directive and constexpr.
* constexpr.c (cxx_eval_constant_expression): Handle USING_STMT. From-SVN: r257762
This commit is contained in:
parent
6f58bc5825
commit
3664e317b8
@ -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.
|
||||
|
||||
|
@ -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)))
|
||||
{
|
||||
|
13
gcc/testsuite/g++.dg/ext/stmtexpr22.C
Normal file
13
gcc/testsuite/g++.dg/ext/stmtexpr22.C
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user