From 98ed9dae3ad020898a04cbf7363d51647b441ad6 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 8 Jun 2005 11:49:23 +0000 Subject: re PR c++/19497 (Invalid declaration in template diagnosed too late) cp: PR c++/19497 * cp-tree.def (USING_DECL): Update documentation. * cp-tree.h (DECL_DEPENDENT_P): New. (USING_DECL_DECLS, USING_DECL_SCOPE): New. * class.c (handle_using_decl): Move most of the processing to ... * name-lookup.c (do_class_using_decl): ... here. Make stricter. (push_using_decl): Use USING_DECL_SCOPE. (cp_emit_debug_info_for_using): Make extern. * cxx-pretty-print.c (pp_cxx_statement) : Adjust. * name-lookup.h (cp_emit_debug_info_for_using): Declare. * pt.c (tsubst_decl) : Use do_class_using_decl when tsubsting. (tsubst_expr): Use USING_DECL_SCOPE. * search.c (lookup_field_1): Use DECL_DEPENDENT_P. * semantics.c (finish_member_declaration): Likewise. testsuite: PR c++/19497 * g++.dg/inherit/using5.C: New. * g++.dg/inherit/using6.C: New. From-SVN: r100757 --- gcc/cp/search.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gcc/cp/search.c') diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 45668a1..8dec18e 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -471,9 +471,8 @@ lookup_field_1 (tree type, tree name, bool want_type) defined, USING_DECLs are purged from TYPE_FIELDS; see handle_using_decl. However, we make special efforts to make using-declarations in class templates and class - template partial specializations work correctly noticing - that dependent USING_DECL's do not have TREE_TYPE set. */ - if (TREE_TYPE (field)) + template partial specializations work correctly. */ + if (!DECL_DEPENDENT_P (field)) continue; } -- cgit v1.1