diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-03 12:17:59 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-03 12:17:59 +0000 |
commit | 73556f5f6c5d835df3baa9979de74da7bd85cd05 (patch) | |
tree | ac76e75c45976914468f05d9d01c6dab44ff831c /gcc/cp/semantics.c | |
parent | 009b254c18c50184aadbc41673222104cec47838 (diff) | |
download | gcc-73556f5f6c5d835df3baa9979de74da7bd85cd05.tar.gz |
2011-01-03 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 168414
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@168419 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 25b99320fa6..aeb10fec8ac 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2797,7 +2797,8 @@ finish_id_expression (tree id_expression, the current class so that we can check later to see if the meaning would have been different after the class was entirely defined. */ - if (!scope && decl != error_mark_node) + if (!scope && decl != error_mark_node + && TREE_CODE (id_expression) == IDENTIFIER_NODE) maybe_note_name_used_in_class (id_expression, decl); /* Disallow uses of local variables from containing functions, except @@ -5440,11 +5441,25 @@ build_data_member_initialization (tree t, VEC(constructor_elt,gc) **vec) if (t == error_mark_node) return false; if (TREE_CODE (t) == CLEANUP_STMT) - /* We can't see a CLEANUP_STMT in a constructor for a literal class, - but we can in a constexpr constructor for a non-literal class. Just - ignore it; either all the initialization will be constant, in which - case the cleanup can't run, or it can't be constexpr. */ - return true; + { + /* We can't see a CLEANUP_STMT in a constructor for a literal class, + but we can in a constexpr constructor for a non-literal class. Just + ignore it; either all the initialization will be constant, in which + case the cleanup can't run, or it can't be constexpr. + Still recurse into CLEANUP_BODY. */ + t = CLEANUP_BODY (t); + if (TREE_CODE (t) == STATEMENT_LIST) + { + tree_stmt_iterator i; + for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i)) + { + if (! build_data_member_initialization (tsi_stmt (i), vec)) + return false; + } + return true; + } + return build_data_member_initialization (t, vec); + } if (TREE_CODE (t) == CONVERT_EXPR) t = TREE_OPERAND (t, 0); if (TREE_CODE (t) == INIT_EXPR |