diff options
author | Jason Merrill <jason@redhat.com> | 2014-06-05 13:30:51 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-06-05 13:30:51 -0400 |
commit | f0f2f975ac40291d471dd1453f6f89512fc22927 (patch) | |
tree | 39948b9c48a93e9fc04477b797b9d6b4bf5b9ee3 /gcc/cp/decl.c | |
parent | 5853e181e6cb670ea90fe11afbe26a94aee76291 (diff) | |
download | gcc-f0f2f975ac40291d471dd1453f6f89512fc22927.zip gcc-f0f2f975ac40291d471dd1453f6f89512fc22927.tar.gz gcc-f0f2f975ac40291d471dd1453f6f89512fc22927.tar.bz2 |
re PR c++/61343 ([C++11] Missing default initialization for class with default constructor)
PR c++/61343
* decl.c (check_initializer): Maybe clear
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
From-SVN: r211284
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3d4058c..b068df8 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5856,6 +5856,13 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups) if (init && init != error_mark_node) init_code = build2 (INIT_EXPR, type, decl, init); + if (init_code) + { + /* We might have set these in cp_finish_decl. */ + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = false; + TREE_CONSTANT (decl) = false; + } + if (init_code && DECL_IN_AGGR_P (decl)) { static int explained = 0; |