aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2005-05-02 04:22:45 +0000
committerMichael Matz <matz@gcc.gnu.org>2005-05-02 04:22:45 +0000
commitb2f97e4a12858733fc4977859febecd144acb8dd (patch)
tree81e0ec0700839598638506aadcfb471636db87e6 /gcc/cp
parentf8f9fb4526bea97382af2024b7b268725d544239 (diff)
downloadgcc-b2f97e4a12858733fc4977859febecd144acb8dd.zip
gcc-b2f97e4a12858733fc4977859febecd144acb8dd.tar.gz
gcc-b2f97e4a12858733fc4977859febecd144acb8dd.tar.bz2
re PR c++/19542 (attribute(sentinel) has problems with C++ __null)
PR c++/19542 * c-common.c (c_common_nodes_and_builtins): Create global null_node. (warn_strict_null_sentinel): Define. (check_function_sentinel): Check for null_node as valid sentinel too. * c-common.h (c_tree_index): Added CTI_NULL. (null_node) Define global_tree[CTI_NULL]. (warn_strict_null_sentinel): Declare. * c-opts.c: (c_common_handle_option): Handle -Wstrict-null-sentinel. * c.opt: (Wstrict-null-sentinel): New C++ option. * doc/invoke.texi (C++ Options): Document -Wstrict-null-sentinel. * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C common frontend. (null_node): Remove. * lex.c (cxx_init): Move null_node initialisation to C common frontend. * g++.dg/warn/sentinel.C: New testcase for __null sentinels added. From-SVN: r99091
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/lex.c5
3 files changed, 8 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 09677e8..30fbba6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2005-05-02 Michael Matz <matz@suse.de>
+
+ PR c++/19542
+ * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C
+ common frontend.
+ (null_node): Remove.
+ * lex.c (cxx_init): Move null_node initialisation to C common frontend.
+
2005-04-25 Ian Lance Taylor <ian@airs.com>
* cp-tree.def: Add EXPR_STMT.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 05b28dd..8712924 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -518,7 +518,6 @@ enum cp_tree_index
CPTI_LANG_NAME_JAVA,
CPTI_EMPTY_EXCEPT_SPEC,
- CPTI_NULL,
CPTI_JCLASS,
CPTI_TERMINATE,
CPTI_CALL_UNEXPECTED,
@@ -614,9 +613,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
/* Exception specifier used for throw(). */
#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
-/* The node for `__null'. */
-#define null_node cp_global_trees[CPTI_NULL]
-
/* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */
#define jclass_node cp_global_trees[CPTI_JCLASS]
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index c5f21d1..04f648f 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -347,11 +347,6 @@ cxx_init (void)
cxx_init_decl_processing ();
- /* Create the built-in __null node. It is important that this is
- not shared. */
- null_node = make_node (INTEGER_CST);
- TREE_TYPE (null_node) = c_common_type_for_size (POINTER_SIZE, 0);
-
/* The fact that G++ uses COMDAT for many entities (inline
functions, template instantiations, virtual tables, etc.) mean
that it is fundamentally unreliable to try to make decisions