Commit f9438bbb by Jason Merrill Committed by Jason Merrill

PR c++/77907 - static init and PMF

	* constexpr.c (cxx_eval_constant_expression): Use cp_fold_convert.

From-SVN: r242906
parent c190974f
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
......
......@@ -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)
......
// 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; }
......
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