summaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-09 08:16:49 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-09 08:16:49 +0000
commit28bbd27a09dc1c4cc88f24ac1088c9e8472d0f5b (patch)
tree4053bda91421405c7881ecbb817f38fb71ebe500 /gcc/cp/name-lookup.c
parent7c9e3513b011c9127ccbea3cd77ac44b3dd8b057 (diff)
downloadgcc-28bbd27a09dc1c4cc88f24ac1088c9e8472d0f5b.tar.gz
PR c++/14401
* class.c (check_field_decls): Complain about non-static data members of reference type in unions. Propagate CLASSTYPE_REF_FIELDS_NEED_INIT and CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static data members. * init.c (perform_member_init): Complain about mbmers with const type that are not explicitly initialized. PR c++/14401 * g++.dg/init/ctor3.C: New test. * g++.dg/init/union1.C: New test. * g++.dg/ext/anon-struct4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79158 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r--gcc/cp/name-lookup.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 1da453a016d..82e583c3351 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -36,7 +36,6 @@ static cxx_scope *innermost_nonclass_level (void);
static tree select_decl (cxx_binding *, int);
static cxx_binding *binding_for_name (cxx_scope *, tree);
static tree lookup_name_current_level (tree);
-static void push_local_binding (tree, tree, int);
static tree push_overloaded_decl (tree, int);
static bool lookup_using_namespace (tree, cxx_binding *, tree,
tree, int);
@@ -647,13 +646,7 @@ pushdecl (tree x)
t = NULL_TREE;
}
- if (t == error_mark_node)
- {
- /* error_mark_node is 0 for a while during initialization! */
- t = NULL_TREE;
- cp_error_at ("`%#D' used prior to declaration", x);
- }
- else if (t != NULL_TREE)
+ if (t && t != error_mark_node)
{
if (different_binding_level)
{
@@ -830,24 +823,6 @@ pushdecl (tree x)
|| TREE_CODE (x) == TEMPLATE_DECL))
SET_IDENTIFIER_NAMESPACE_VALUE (name, x);
- /* Don't forget if the function was used via an implicit decl. */
- if (IDENTIFIER_IMPLICIT_DECL (name)
- && TREE_USED (IDENTIFIER_IMPLICIT_DECL (name)))
- TREE_USED (x) = 1;
-
- /* Don't forget if its address was taken in that way. */
- if (IDENTIFIER_IMPLICIT_DECL (name)
- && TREE_ADDRESSABLE (IDENTIFIER_IMPLICIT_DECL (name)))
- TREE_ADDRESSABLE (x) = 1;
-
- /* Warn about mismatches against previous implicit decl. */
- if (IDENTIFIER_IMPLICIT_DECL (name) != NULL_TREE
- /* If this real decl matches the implicit, don't complain. */
- && ! (TREE_CODE (x) == FUNCTION_DECL
- && TREE_TYPE (TREE_TYPE (x)) == integer_type_node))
- warning
- ("`%D' was previously implicitly declared to return `int'", x);
-
/* If new decl is `static' and an `extern' was seen previously,
warn about it. */
if (x != NULL_TREE && t != NULL_TREE && decls_match (x, t))
@@ -1035,7 +1010,7 @@ maybe_push_decl (tree decl)
doesn't really belong to this binding level, that it got here
through a using-declaration. */
-static void
+void
push_local_binding (tree id, tree decl, int flags)
{
struct cp_binding_level *b;