public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12037] New: Spurious "statement has no effect" in templates
@ 2003-08-22 22:20 bangerth at dealii dot org
  2003-08-22 22:32 ` [Bug c++/12037] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2003-08-22 22:20 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12037

           Summary: Spurious "statement has no effect" in templates
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org,nathan at gcc dot gnu
                    dot org

I was pretty sure someone (I?) had already reported this, but I can't find it no more: 
--------------------------------- 
#include <iostream> 
 
template <int> void f () { 
  std::cout << "   "; 
} 
--------------------------------- 
With present mainline we get: 
deal.II/base> ~/tmp/build-gcc/gcc-install/bin/c++ -W -Wall -c x.cc 
x.cc: In function `void f()': 
x.cc:4: warning: statement has no effect 
 
That's clearly bogus. I thought it might be related to PR 11964 and PR 11957, but these 
two are already closed, whereas this still happens with last night's CVS. 
 
W.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/12037] [3.4 Regression] Spurious "statement has no effect" in templates
  2003-08-22 22:20 [Bug c++/12037] New: Spurious "statement has no effect" in templates bangerth at dealii dot org
@ 2003-08-22 22:32 ` pinskia at gcc dot gnu dot org
  2003-08-22 22:39 ` bangerth at dealii dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-22 22:32 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12037


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
           Priority|P2                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-22 22:32:17
               date|                            |
            Summary|Spurious "statement has no  |[3.4 Regression] Spurious
                   |effect" in templates        |"statement has no effect" in
                   |                            |templates


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-22 22:32 -------
No some reported it to the mailing list but that is all (I had told him to open a bug so it would not 
get lost but it looks like he did not).
I can confirm this on the mainline (20030822).


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/12037] [3.4 Regression] Spurious "statement has no effect" in templates
  2003-08-22 22:20 [Bug c++/12037] New: Spurious "statement has no effect" in templates bangerth at dealii dot org
  2003-08-22 22:32 ` [Bug c++/12037] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-08-22 22:39 ` bangerth at dealii dot org
  2003-08-23 13:56 ` nathan at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2003-08-22 22:39 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12037


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gerald at pfeifer dot com


------- Additional Comments From bangerth at dealii dot org  2003-08-22 22:39 -------
I recalled it was Gerald who reported this and I searched his PRs but couldn't find 
ont. Seems as if he had a busy day, then. Well, now it's in bugzilla. 
 
W.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/12037] [3.4 Regression] Spurious "statement has no effect" in templates
  2003-08-22 22:20 [Bug c++/12037] New: Spurious "statement has no effect" in templates bangerth at dealii dot org
  2003-08-22 22:32 ` [Bug c++/12037] [3.4 Regression] " pinskia at gcc dot gnu dot org
  2003-08-22 22:39 ` bangerth at dealii dot org
@ 2003-08-23 13:56 ` nathan at gcc dot gnu dot org
  2003-09-05  8:22 ` nathan at gcc dot gnu dot org
  2003-09-05  8:24 ` cvs-commit at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-08-23 13:56 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12037


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/12037] [3.4 Regression] Spurious "statement has no effect" in templates
  2003-08-22 22:20 [Bug c++/12037] New: Spurious "statement has no effect" in templates bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2003-08-23 13:56 ` nathan at gcc dot gnu dot org
@ 2003-09-05  8:22 ` nathan at gcc dot gnu dot org
  2003-09-05  8:24 ` cvs-commit at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-09-05  8:22 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12037


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From nathan at gcc dot gnu dot org  2003-09-05 08:22 -------
2003-09-05  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/12037
	* cp-tree.h (COMPOUND_EXPR_OVERLOADED): New.
	(build_min_non_dep): Declare.
	* tree.c (build_min): Propagate TREE_SIDE_EFFECTS.
	(build_min_non_dep): New.
	* cvt.c (convert_to_void): Don't explicitly copy
	TREE_SIDE_EFFECTS, TREE_NO_UNUSED_WARNING.
	* call.c (build_new_method_call): Use build_min_non_dep.
	* decl2.c (grok_array_decl): Likewise.
	(build_offset_ref_call_from_tree): Likewise.
	* typeck.c (finish_class_member_access_expr,
	build_x_indirect_ref, build_x_binary_op, build_x_unary_op,
	build_x_conditional_expr, build_x_compound_expr): Likewise.
	(build_static_cast, build_reinterpret_cast,
	build_const_cast): Propagate TREE_SIDE_EFFECTS inside a template.
	* typeck2.c (build_x_arrow): Use build_min_non_dep.
	(build_functional_cast): Propagate TREE_SIDE_EFFECTS inside a
	template.
	* rtti.c (build_dynamic_cast_1): Set DECL_IS_PURE.
	(build_dynamic_cast): Set TREE_SIDE_EFFECTS.
	* pt.c (build_non_dependent_expr): Check COMPOUND_EXPR_OVERLOADED.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/12037] [3.4 Regression] Spurious "statement has no effect" in templates
  2003-08-22 22:20 [Bug c++/12037] New: Spurious "statement has no effect" in templates bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2003-09-05  8:22 ` nathan at gcc dot gnu dot org
@ 2003-09-05  8:24 ` cvs-commit at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-05  8:24 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12037



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-09-05 08:24 -------
Subject: Bug 12037

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2003-09-05 08:24:28

Modified files:
	gcc/cp         : ChangeLog call.c cp-tree.h cvt.c decl2.c pt.c 
	                 rtti.c tree.c typeck.c typeck2.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/warn: noeffect4.C 

Log message:
	cp:
	PR c++/12037
	* cp-tree.h (COMPOUND_EXPR_OVERLOADED): New.
	(build_min_non_dep): Declare.
	* tree.c (build_min): Propagate TREE_SIDE_EFFECTS.
	(build_min_non_dep): New.
	* cvt.c (convert_to_void): Don't explicitly copy
	TREE_SIDE_EFFECTS, TREE_NO_UNUSED_WARNING.
	* call.c (build_new_method_call): Use build_min_non_dep.
	* decl2.c (grok_array_decl): Likewise.
	(build_offset_ref_call_from_tree): Likewise.
	* typeck.c (finish_class_member_access_expr,
	build_x_indirect_ref, build_x_binary_op, build_x_unary_op,
	build_x_conditional_expr, build_x_compound_expr): Likewise.
	(build_static_cast, build_reinterpret_cast,
	build_const_cast): Propagate TREE_SIDE_EFFECTS inside a template.
	* typeck2.c (build_x_arrow): Use build_min_non_dep.
	(build_functional_cast): Propagate TREE_SIDE_EFFECTS inside a
	template.
	* rtti.c (build_dynamic_cast_1): Set DECL_IS_PURE.
	(build_dynamic_cast): Set TREE_SIDE_EFFECTS.
	* pt.c (build_non_dependent_expr): Check COMPOUND_EXPR_OVERLOADED.
	testsuite:
	PR c++/12037
	* g++.dg/warn/noeffect4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3646&r2=1.3647
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.429&r2=1.430
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.912&r2=1.913
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cvt.c.diff?cvsroot=gcc&r1=1.144&r2=1.145
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.666&r2=1.667
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.772&r2=1.773
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&r1=1.172&r2=1.173
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.344&r2=1.345
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.499&r2=1.500
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.148&r2=1.149
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3023&r2=1.3024
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/noeffect4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-09-05  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-22 22:20 [Bug c++/12037] New: Spurious "statement has no effect" in templates bangerth at dealii dot org
2003-08-22 22:32 ` [Bug c++/12037] [3.4 Regression] " pinskia at gcc dot gnu dot org
2003-08-22 22:39 ` bangerth at dealii dot org
2003-08-23 13:56 ` nathan at gcc dot gnu dot org
2003-09-05  8:22 ` nathan at gcc dot gnu dot org
2003-09-05  8:24 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).