diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2005-06-08 11:49:23 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-06-08 11:49:23 +0000 |
commit | 98ed9dae3ad020898a04cbf7363d51647b441ad6 (patch) | |
tree | 33d1230b127cd93152bb163e84c576691088bbac /gcc/cp/cp-tree.h | |
parent | cb6d4a9fce89e5bea9476338870125bac9b83e96 (diff) | |
download | gcc-98ed9dae3ad020898a04cbf7363d51647b441ad6.zip gcc-98ed9dae3ad020898a04cbf7363d51647b441ad6.tar.gz gcc-98ed9dae3ad020898a04cbf7363d51647b441ad6.tar.bz2 |
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) <USING_DECL case>: Adjust.
* name-lookup.h (cp_emit_debug_info_for_using): Declare.
* pt.c (tsubst_decl) <USING_DECL case>: 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
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 90de20c..bb234bb 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -93,6 +93,7 @@ struct diagnostic_context; DECL_TEMPLATE_PARM_P (in PARM_DECL, CONST_DECL, TYPE_DECL, or TEMPLATE_DECL) DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL) DECL_MUTABLE_P (in FIELD_DECL) + DECL_DEPENDENT_P (in USING_DECL) 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL). DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL) DECL_MEMBER_TEMPLATE_P (in TEMPLATE_DECL) @@ -2039,6 +2040,15 @@ struct lang_decl GTY(()) directives */ #define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->common.lang_flag_0) +/* Non zero if this is a using decl for a dependent scope. */ +#define DECL_DEPENDENT_P(NODE) DECL_LANG_FLAG_0 (USING_DECL_CHECK (NODE)) + +/* The scope named in a using decl. */ +#define USING_DECL_SCOPE(NODE) TREE_TYPE (USING_DECL_CHECK (NODE)) + +/* The decls named by a using decl. */ +#define USING_DECL_DECLS(NODE) DECL_INITIAL (USING_DECL_CHECK (NODE)) + /* In a VAR_DECL for a variable declared in a for statement, this is the shadowed (local) variable. */ #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT_FLD(VAR_DECL_CHECK (NODE)) |