From 7c355bca10d745fdac57df6a07e1c92fbe3ed8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Fri, 5 Nov 1999 23:11:58 +0000 Subject: cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. (DECL_TEMPLATE_INFO): Use it. * decl.c (warn_extern_redeclared_static): Do nothing for TEMPLATE_DECLs. * decl2.c (mark_used): Explicitly check for function or variable. * semantics.c (finish_unary_op_expr): Check whether result is also an INTEGER_CST. From-SVN: r30426 --- gcc/cp/cp-tree.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'gcc/cp/cp-tree.h') diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 6f8f1b7..47bb32b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -134,6 +134,17 @@ Boston, MA 02111-1307, USA. */ __LINE__, __PRETTY_FUNCTION__); \ __t; }) +#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) \ +({ const tree __t = NODE; \ + enum tree_code __c = TREE_CODE(__t); \ + if (__c != VAR_DECL \ + && __c != FUNCTION_DECL \ + && __c != TYPE_DECL \ + && __c != TEMPLATE_DECL) \ + tree_check_failed (__t, VAR_DECL, __FILE__, \ + __LINE__, __PRETTY_FUNCTION__); \ + __t; }) + #define RECORD_OR_UNION_TYPE_CHECK(NODE) \ ({ const tree __t = NODE; \ enum tree_code __c = TREE_CODE(__t); \ @@ -145,6 +156,7 @@ Boston, MA 02111-1307, USA. */ #else /* not ENABLE_CHECKING, or not gcc */ #define VAR_OR_FUNCTION_DECL_CHECK(NODE) NODE +#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) NODE #define RECORD_OR_UNION_TYPE_CHECK(NODE) NODE #endif @@ -1601,7 +1613,8 @@ struct lang_decl_flags tree context; union { - /* In a FUNCTION_DECL or a VAR_DECL, this is DECL_TEMPLATE_INFO. */ + /* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this + is DECL_TEMPLATE_INFO. */ tree template_info; /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */ @@ -1838,9 +1851,10 @@ struct lang_decl #define DECL_SAVED_INLINE(DECL) \ (DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline) -/* For a VAR_DECL or FUNCTION_DECL: template-specific information. */ +/* For a VAR_DECL, FUNCTION_DECL, TYPE_DECL or TEMPLATE_DECL: + template-specific information. */ #define DECL_TEMPLATE_INFO(NODE) \ - (DECL_LANG_SPECIFIC(VAR_OR_FUNCTION_DECL_CHECK (NODE))->decl_flags.u.template_info) + (DECL_LANG_SPECIFIC(VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK (NODE))->decl_flags.u.template_info) /* Template information for a RECORD_TYPE or UNION_TYPE. */ #define CLASSTYPE_TEMPLATE_INFO(NODE) \ -- cgit v1.1