diff options
author | Seongbae Park <seongbae.park@gmail.com> | 2007-05-02 23:11:13 +0000 |
---|---|---|
committer | Seongbae Park <spark@gcc.gnu.org> | 2007-05-02 23:11:13 +0000 |
commit | ba99296704bd337a302e5dee43dc57f013d1177b (patch) | |
tree | 607c7af016a22b560e2c1a42510cf7ce4d505d96 /gcc/c-common.c | |
parent | e0310afb08cc322a877a51e232bda6efe59d92ed (diff) | |
download | gcc-ba99296704bd337a302e5dee43dc57f013d1177b.zip gcc-ba99296704bd337a302e5dee43dc57f013d1177b.tar.gz gcc-ba99296704bd337a302e5dee43dc57f013d1177b.tar.bz2 |
re PR c++/31663 (Segfault in constrain_class_visibility with anonymous namespace)
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.
From-SVN: r124363
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index d60b5a4..4e92ae6 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 |