diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-20 18:00:09 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-20 18:00:09 +0000 |
commit | 11dfb79c5033ddb5a88fbf1cba31b10015df0aa5 (patch) | |
tree | 5a3085908e5444b2d648003ad19dda683f9fac3c /gcc/testsuite | |
parent | 30e23acf269fc543557d02a61c9f9d3539f5e8fa (diff) | |
download | gcc-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/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/noeffect2.C | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1020020022b..bbbf552c530 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-08-20 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/11945 + * g++.dg/warn/noeffect2.C: New test. + 2003-08-19 Mark Mitchell <mark@codesourcery.com> PR c++/10926 @@ -54,6 +59,9 @@ 2003-08-18 Nathan Sidwell <nathan@codesourcery.com> + PR c++/11957 + * g++.dg/warn/noeffect1.C: New test. + * g++.dg/template/scope2.C: New test. * g++.dg/template/error2.C: Correct dg-error diff --git a/gcc/testsuite/g++.dg/warn/noeffect2.C b/gcc/testsuite/g++.dg/warn/noeffect2.C new file mode 100644 index 00000000000..7bd2925f542 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/noeffect2.C @@ -0,0 +1,18 @@ +// { dg-do compile } +// { dg-options "-Wall" } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 18 Aug 2003 <nathan@codesourcery.com> +// Origin PR 11945 gerald@pfeifer.com + +// PR 11945 inconsistent warnings + +extern "C" void FormatDisk(); + template <class T> + struct C { + C(){ FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" } + }; + template <class T> + void f() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" } +void g() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" } + |