[Bug c++/15333] New: Bogus warning: statement has no effect (regression)
ofv at wanadoo dot es
gcc-bugzilla@gcc.gnu.org
Thu May 6 23:21:00 GMT 2004
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
More information about the Gcc-bugs
mailing list