diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2009-05-05 13:00:03 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2009-05-05 13:00:03 +0000 |
commit | 95e207682899fcbf2bcfc43dd2926a6e866e884a (patch) | |
tree | 4ea69e4744077e7a5591e81e2452d87a81f52039 /gcc/cp/typeck.c | |
parent | 66ba9b0b152bf853249f594655c0791189b10fc6 (diff) | |
download | gcc-95e207682899fcbf2bcfc43dd2926a6e866e884a.zip gcc-95e207682899fcbf2bcfc43dd2926a6e866e884a.tar.gz gcc-95e207682899fcbf2bcfc43dd2926a6e866e884a.tar.bz2 |
typeck.c (cp_build_compound_expr): Require RHS to have a known type.
cp/
* typeck.c (cp_build_compound_expr): Require RHS to have a known
type.
* class.c (resolve_address_of_overloaded_function): Use
OVL_CURRENT for error message.
(instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
with them. Do not copy the node.
testsuite/
* g++.old-deja/g++.other/overload11.C: Adjust expected errors.
* g++.dg/template/overload9.C: Likewise.
* g++.dg/ext/ms-1.C: New.
From-SVN: r147125
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r-- | gcc/cp/typeck.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 5486c54..e34d942 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5034,6 +5034,12 @@ cp_build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain) return rhs; } + if (type_unknown_p (rhs)) + { + error ("no context to resolve type of %qE", rhs); + return error_mark_node; + } + return build2 (COMPOUND_EXPR, TREE_TYPE (rhs), lhs, rhs); } |