diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2004-09-23 18:22:25 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@gcc.gnu.org> | 2004-09-23 18:22:25 +0000 |
commit | 037cc9c5dce2bd0569c90e67ab9760d36e1c620f (patch) | |
tree | df77b7d51d9b71c598887245fda31d867e50e5b6 /gcc/cp/cvt.c | |
parent | 093942ac675fab472ce829446c86b8233f25ee1d (diff) | |
download | gcc-037cc9c5dce2bd0569c90e67ab9760d36e1c620f.zip gcc-037cc9c5dce2bd0569c90e67ab9760d36e1c620f.tar.gz gcc-037cc9c5dce2bd0569c90e67ab9760d36e1c620f.tar.bz2 |
PR c++/9844, PR c++/13989
PR c++/9844, PR c++/13989
Reviewed by Mark Mitchel.
From-SVN: r87971
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index cb179d5..5db4146 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -699,7 +699,20 @@ ocp_convert (tree type, tree expr, int convtype, int flags) if (POINTER_TYPE_P (type) || TYPE_PTR_TO_MEMBER_P (type)) return fold (cp_convert_to_pointer (type, e, false)); if (code == VECTOR_TYPE) - return fold (convert_to_vector (type, e)); + { + tree in_vtype = TREE_TYPE (e); + if (IS_AGGR_TYPE (in_vtype)) + { + tree ret_val; + ret_val = build_type_conversion (type, e); + if (ret_val) + return ret_val; + if (flags & LOOKUP_COMPLAIN) + error ("`%#T' used where a `%T' was expected", in_vtype, type); + return error_mark_node; + } + return fold (convert_to_vector (type, e)); + } if (code == REAL_TYPE || code == COMPLEX_TYPE) { if (IS_AGGR_TYPE (TREE_TYPE (e))) |