aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-07-03 18:13:44 +0000
committerMark Mitchell <mark@codesourcery.com>2003-07-03 18:13:44 +0000
commit2fe7079f39bcf0dea905c2090e9f8c3caece253b (patch)
tree7a1b74d528559e87eba7c56bcafd46a0a8dea100 /gcc/cp/decl2.c
parentd19563f50ae8148e8124bc153985ec0a30203577 (diff)
* call.c (build_scoped_method_call): Use convert_to_void.
(build_method_call): Likewise. * class.c (check_field_decls): Remove dead code. * cvt.c (convert_from_reference): Remove OFFSET_TYPE handling. * decl2.c (grok_array_decl): Remove dead code. (arg_assoc_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE as pointer-to-member representation. * init.c (build_offset_ref): Tidy. (build_vec_delete_1): Use convert_to_void. * mangle.c (write_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE as pointer-to-member representation. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@68895 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index ab29aeed45d..f7010378897 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -407,16 +407,9 @@ grok_array_decl (tree array_expr, tree index_exp)
return build_min (ARRAY_REF, type ? TREE_TYPE (type) : NULL_TREE,
array_expr, index_exp);
- if (type == NULL_TREE)
- {
- /* Something has gone very wrong. Assume we are mistakenly reducing
- an expression instead of a declaration. */
- error ("parser may be lost: is there a '{' missing somewhere?");
- return NULL_TREE;
- }
+ my_friendly_assert (type, 20030626);
- if (TREE_CODE (type) == OFFSET_TYPE
- || TREE_CODE (type) == REFERENCE_TYPE)
+ if (TREE_CODE (type) == REFERENCE_TYPE)
type = TREE_TYPE (type);
/* If they have an `operator[]', use that. */
@@ -4069,8 +4062,15 @@ arg_assoc_type (struct arg_lookup *k, tree type)
right, we can end up with such things without a type. */
if (!type)
return false;
-
- switch (TREE_CODE (type))
+
+ if (TYPE_PTRMEM_P (type))
+ {
+ /* Pointer to member: associate class type and value type. */
+ if (arg_assoc_type (k, TYPE_PTRMEM_CLASS_TYPE (type)))
+ return true;
+ return arg_assoc_type (k, TYPE_PTRMEM_POINTED_TO_TYPE (type));
+ }
+ else switch (TREE_CODE (type))
{
case ERROR_MARK:
return false;
@@ -4093,11 +4093,6 @@ arg_assoc_type (struct arg_lookup *k, tree type)
case UNION_TYPE:
case ENUMERAL_TYPE:
return arg_assoc_namespace (k, decl_namespace (TYPE_MAIN_DECL (type)));
- case OFFSET_TYPE:
- /* Pointer to member: associate class type and value type. */
- if (arg_assoc_type (k, TYPE_OFFSET_BASETYPE (type)))
- return true;
- return arg_assoc_type (k, TREE_TYPE (type));
case METHOD_TYPE:
/* The basetype is referenced in the first arg type, so just
fall through. */