This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/8057] [3.4/4.0/4.1 regression] Templates/non-templates and warnings about statements without effects
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2005 22:33:57 -0000
- Subject: [Bug c++/8057] [3.4/4.0/4.1 regression] Templates/non-templates and warnings about statements without effects
- References: <bug-8057-180@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from mark at codesourcery dot com 2005-10-11 22:33 -------
Subject: Re: [3.4/4.0/4.1 regression] Templates/non-templates
and warnings about statements without effects
With the proposed patch, what happens with something like:
template <typename T>
void f() {
T(); /* Has side-effects only if T is a class type. */
}
In general, I'm concerned about warning only at template-declaration
time because I don't think we can be sure we can see all side effects at
that point. I think it would be more reliable (and more consistent with
the overall approach in G++) to warn only in the instantiations.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8057