Allow references in constant-expressions.
authorJason Merrill <jason@redhat.com>
Tue, 15 Nov 2016 14:55:52 +0000 (09:55 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 15 Nov 2016 14:55:52 +0000 (09:55 -0500)
commitfd338b13644908314b288c10dc2fb46b72aeb300
tree4eeb16c9eebc8c51f8f4cf99cc607d14a9907fe6
parentf05a874c256b90e0c45815b657ef0b9682e26189
Allow references in constant-expressions.

* decl2.c (decl_maybe_constant_var_p): References qualify.
* constexpr.c (non_const_var_error): Handle references.
* init.c (constant_value_1): Always check decl_constant_var_p.
* cp-gimplify.c (cp_fold_maybe_rvalue): Don't fold references.
* error.c (dump_decl_name): Split out from dump_decl.

From-SVN: r242422
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-gimplify.c
gcc/cp/decl2.c
gcc/cp/error.c
gcc/cp/init.c
gcc/testsuite/g++.dg/cpp0x/constexpr-ref10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ref9.C [new file with mode: 0644]