diff options
author | Lee Millward <lee.millward@gmail.com> | 2006-06-25 11:07:05 +0000 |
---|---|---|
committer | Lee Millward <lmillward@gcc.gnu.org> | 2006-06-25 11:07:05 +0000 |
commit | 0fdc23b94d00f5c541a71456b0704534f4731ddc (patch) | |
tree | d143af69c41e1e11781a2936d5748d73ac647365 /gcc | |
parent | 8df7d4395aea856c396996e16c8b2986041b11f1 (diff) | |
download | gcc-0fdc23b94d00f5c541a71456b0704534f4731ddc.zip gcc-0fdc23b94d00f5c541a71456b0704534f4731ddc.tar.gz gcc-0fdc23b94d00f5c541a71456b0704534f4731ddc.tar.bz2 |
re PR c++/28051 (ICE on invalid conversion operator)
PR c++/28051
* mangle.c (mangle_conv_op_name_for_type): Check for
invalid types.
*name-lookup.c (push_class_level_binding): Robustify.
(do_class_using_decl): Return early if name is error_mark_node.
From-SVN: r114985
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 3 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/using13.C | 11 |
5 files changed, 33 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5a3ac21..dae7f43 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2006-06-25 Lee Millward <lee.millward@gmail.com> + + PR c++/28051 + * mangle.c (mangle_conv_op_name_for_type): Check for + invalid types. + * name-lookup.c (push_class_level_binding): Robustify. + (do_class_using_decl): Return early if name is error_mark_node. + 2006-06-23 Steve Ellcey <sje@cup.hp.com> PR c++/28114 diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index b870292..8c8eff9 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2816,6 +2816,9 @@ mangle_conv_op_name_for_type (const tree type) void **slot; tree identifier; + if (type == error_mark_node) + return error_mark_node; + if (conv_type_names == NULL) conv_type_names = htab_create_ggc (31, &hash_type, &compare_type, NULL); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 0d195f9..ea985e4 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2609,6 +2609,9 @@ push_class_level_binding (tree name, tree x) if (!class_binding_level) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true); + if (name == error_mark_node) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, false); + /* Check for invalid member names. */ gcc_assert (TYPE_BEING_DEFINED (current_class_type)); /* We could have been passed a tree list if this is an ambiguous @@ -2763,6 +2766,9 @@ do_class_using_decl (tree scope, tree name) tree base_binfo; int i; + if (name == error_mark_node) + return NULL_TREE; + if (!scope || !TYPE_P (scope)) { error ("using-declaration for non-member at class scope"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a8598aa..09a6265 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-06-25 Lee Millward <lee.millward@gmail.com> + + PR c++/28051 + * g++.dg/template/using13.C: New test. + 2006-06-24 Francois-Xavier Coudert <coudert@clipper.ens.fr> PR fortran/28081 diff --git a/gcc/testsuite/g++.dg/template/using13.C b/gcc/testsuite/g++.dg/template/using13.C new file mode 100644 index 0000000..3f86ede --- /dev/null +++ b/gcc/testsuite/g++.dg/template/using13.C @@ -0,0 +1,11 @@ +//PR c++/28051 + +template<int> struct A {}; + +template<int N> struct B : A<N> +{ + using A<N>::operator typename A<N>::X; // { dg-error "no type named" } +}; + +B<0> b; + |