summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-20 18:00:09 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-20 18:00:09 +0000
commit11dfb79c5033ddb5a88fbf1cba31b10015df0aa5 (patch)
tree5a3085908e5444b2d648003ad19dda683f9fac3c /gcc/cp/semantics.c
parent30e23acf269fc543557d02a61c9f9d3539f5e8fa (diff)
downloadgcc-11dfb79c5033ddb5a88fbf1cba31b10015df0aa5.tar.gz
cp:
PR c++/11945 * pt.c (build_non_dependent_expr): Look inside COND_EXPR and COMPOUND_EXPR. * semantics.c (finish_expr_stmt): Always convert to void. * typeck.c (build_x_compound_exp): Always convert to void. testsuite: PR c++/11945 * g++.dg/warn/noeffect2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70606 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 2997237b06a..78a7f06413a 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -421,6 +421,8 @@ finish_expr_stmt (tree expr)
{
if (!processing_template_decl)
expr = convert_to_void (expr, "statement");
+ else if (!type_dependent_expression_p (expr))
+ convert_to_void (build_non_dependent_expr (expr), "statement");
r = add_stmt (build_stmt (EXPR_STMT, expr));
}