PR c++/77907 - static init and PMF

* constexpr.c (cxx_eval_constant_expression): Use cp_fold_convert.

From-SVN: r242906
This commit is contained in:
Jason Merrill 2016-11-27 23:00:36 -05:00 committed by Jason Merrill
parent c190974fe5
commit f9438bbb2e
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2016-11-27 Jason Merrill <jason@redhat.com>
PR c++/77907
* constexpr.c (cxx_eval_constant_expression): Use cp_fold_convert.
2016-11-24 Martin Liska <mliska@suse.cz>
PR bootstrap/78493

View File

@ -4226,7 +4226,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
{
if (same_type_ignoring_top_level_qualifiers_p (type,
TREE_TYPE (op)))
STRIP_NOPS (t);
return cp_fold_convert (type, op);
else
{
if (!ctx->quiet)

View File

@ -1,6 +1,7 @@
// PR c++/77907
// { dg-do run { target c++11 } }
// { dg-options "-O2" }
// { dg-options "-O2 -save-temps" }
// { dg-final { scan-assembler-not "static_initialization" } }
struct A {
int foo () { return 1; }