summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorspark <spark@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-02 23:11:13 +0000
committerspark <spark@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-02 23:11:13 +0000
commit57a0ed2318b39a94f6ba05241a334acbeabe2bc1 (patch)
tree607c7af016a22b560e2c1a42510cf7ce4d505d96 /gcc/c-common.c
parent1f204d2df210c79fcb79c1805ce2cabf6b3387d8 (diff)
downloadgcc-57a0ed2318b39a94f6ba05241a334acbeabe2bc1.tar.gz
gcc/ChangeLog:
2007-05-02 Seongbae Park <seongbae.park@gmail.com> PR c++/31663 * c-common.c (strip_pointer_or_array_types): New function. * c-common.h (strip_pointer_or_array_types): New function declaration. gcc/cp/ChangeLog: 2007-05-02 Seongbae Park <seongbae.park@gmail.com> PR c++/31663 * decl2.c (constrain_class_visibility): Use strip_pointer_or_array_types instead of strip_array_types. gcc/testsuite/ChangeLog: 2007-05-02 Seongbae Park <seongbae.park@gmail.com> PR C++/31663 * g++.dg/warn/anonymous-namespace-2.C: New. * g++.dg/warn/anonymous-namespace-2.h: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124363 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index d60b5a40957..4e92ae6073d 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -3894,6 +3894,15 @@ strip_pointer_operator (tree t)
return t;
}
+/* Recursively remove pointer or array type from TYPE. */
+tree
+strip_pointer_or_array_types (tree t)
+{
+ while (TREE_CODE (t) == ARRAY_TYPE || POINTER_TYPE_P (t))
+ t = TREE_TYPE (t);
+ return t;
+}
+
/* Used to compare case labels. K1 and K2 are actually tree nodes
representing case labels, or NULL_TREE for a `default' label.
Returns -1 if K1 is ordered before K2, -1 if K1 is ordered after