aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-08-20 18:00:09 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-08-20 18:00:09 +0000
commit47d4c811980d2793dc7502bd3949de2bac374304 (patch)
tree5a3085908e5444b2d648003ad19dda683f9fac3c /gcc/cp/semantics.c
parentf2f3f409f6b69750caf647923bfc8c622f4dd991 (diff)
downloadgcc-47d4c811980d2793dc7502bd3949de2bac374304.zip
gcc-47d4c811980d2793dc7502bd3949de2bac374304.tar.gz
gcc-47d4c811980d2793dc7502bd3949de2bac374304.tar.bz2
re PR c++/11945 (Incorrect warnings issued for comma-expressions inside templates)
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. From-SVN: r70606
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 2997237..78a7f06 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));
}