This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15333] New: Bogus warning: statement has no effect (regression)
- From: "ofv at wanadoo dot es" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2004 23:21:07 -0000
- Subject: [Bug c++/15333] New: Bogus warning: statement has no effect (regression)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I'm seeing hundreds of warnings like this on a project that uses the idiom of
self-registering objects.
It only happens if the constructor is a template.
This is a regression wrt previous gcc releases.
// Test case begins
class B {
public:
B(); // Implemented elsewhere
};
class A {
public:
template <typename T1>
A(T1) {
new B;
}
};
A a(10);
// Test case ends
t:/sec/exp # g++ -c -Wall p.cpp
p.cpp: In constructor `A::A(T1)':
p.cpp:11: warning: statement has no effect
--
Summary: Bogus warning: statement has no effect (regression)
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ofv at wanadoo dot es
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15333