diff options
author | Jason Merrill <jason@redhat.com> | 2011-08-13 16:03:15 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-08-13 16:03:15 -0400 |
commit | 515756b990e1850de7523bef3a198e4b9bfce765 (patch) | |
tree | d1a26b0e6b8ac0a2444e251e1b2058c472f2a219 /gcc/cp/decl.c | |
parent | 8434c30579f31778b63346a8639e3b271964c24e (diff) | |
download | gcc-515756b990e1850de7523bef3a198e4b9bfce765.zip gcc-515756b990e1850de7523bef3a198e4b9bfce765.tar.gz gcc-515756b990e1850de7523bef3a198e4b9bfce765.tar.bz2 |
decl.c (grok_reference_init): Handle constexpr here.
* decl.c (grok_reference_init): Handle constexpr here.
* call.c (initialize_reference): Not here.
From-SVN: r177734
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1db0748..c125f05 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4597,6 +4597,12 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup) explicitly); we need to allow the temporary to be initialized first. */ tmp = initialize_reference (type, init, decl, cleanup, tf_warning_or_error); + if (DECL_DECLARED_CONSTEXPR_P (decl)) + { + tmp = cxx_constant_value (tmp); + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) + = reduced_constant_expression_p (tmp); + } if (tmp == error_mark_node) return NULL_TREE; |