summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-20 17:19:29 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-20 17:19:29 +0000
commita43b59f9103ee50875cb2ffd96a2de78ee9dfd98 (patch)
tree4cccdbbf34c2aaca9c2e9c509c9f1cbfa649af1c
parent20d56cf88618e347221313b8e201e282486c3667 (diff)
downloadppe42-gcc-a43b59f9103ee50875cb2ffd96a2de78ee9dfd98.tar.gz
ppe42-gcc-a43b59f9103ee50875cb2ffd96a2de78ee9dfd98.zip
* call.c (build_object_call): Don't look at DECL_NAME for a type.
(pt.c): Or CP_TYPE_QUALS for an ERROR_MARK. (typeck.c): Or TYPE_MAIN_VARIANT for a type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27068 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/call.c6
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/cp/typeck.c13
4 files changed, 19 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9ade541b37c..d306b09b5e9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
1999-05-20 Mark Mitchell <mark@codesourcery.com>
+ * call.c (build_object_call): Don't look at DECL_NAME for a type.
+ (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
+ (typeck.c): Or TYPE_MAIN_VARIANT for a type.
+
* pt.c (for_each_template_parm): Rework to match documentation.
Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e4b1a0008e0..e6f41875644 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -2336,7 +2336,11 @@ build_object_call (obj, args)
return error_mark_node;
}
- if (DECL_NAME (cand->fn) == ansi_opname [CALL_EXPR])
+ /* Since cand->fn will be a type, not a function, for a conversion
+ function, we must be careful not to unconditionally look at
+ DECL_NAME here. */
+ if (TREE_CODE (cand->fn) == FUNCTION_DECL
+ && DECL_NAME (cand->fn) == ansi_opname [CALL_EXPR])
return build_over_call (cand, mem_args, LOOKUP_NORMAL);
obj = convert_like (TREE_VEC_ELT (cand->convs, 0), obj);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b26fecbfa2e..e4869201bf7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6541,6 +6541,8 @@ tsubst (t, args, complain, in_decl)
}
f = make_typename_type (ctx, f);
+ if (f == error_mark_node)
+ return f;
return cp_build_qualified_type (f,
CP_TYPE_QUALS (f)
| CP_TYPE_QUALS (t));
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index cdc012e332d..c8c11ca7be7 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5077,17 +5077,20 @@ build_conditional_expr (ifexp, op1, op2)
ifexp = op1 = save_expr (ifexp);
}
+ type1 = TREE_TYPE (op1);
+ code1 = TREE_CODE (type1);
+ type2 = TREE_TYPE (op2);
+ code2 = TREE_CODE (type2);
+ if (op1 == error_mark_node || op2 == error_mark_node
+ || type1 == error_mark_node || type2 == error_mark_node)
+ return error_mark_node;
+
ifexp = cp_convert (boolean_type_node, ifexp);
if (TREE_CODE (ifexp) == ERROR_MARK)
return error_mark_node;
/* C++: REFERENCE_TYPES must be dereferenced. */
- type1 = TREE_TYPE (op1);
- code1 = TREE_CODE (type1);
- type2 = TREE_TYPE (op2);
- code2 = TREE_CODE (type2);
-
if (code1 == REFERENCE_TYPE)
{
op1 = convert_from_reference (op1);
OpenPOWER on IntegriCloud