This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21347] New: spurious warning with -Wctor-dtor-privacy
- From: "bh at techhouse dot brown dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 May 2005 21:40:23 -0000
- Subject: [Bug c++/21347] New: spurious warning with -Wctor-dtor-privacy
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
cat > foo.cpp << EOF
class A {
public:
int x;
int getX() { return x; } // comment out to avoid warning
};
int foo() {
A a; // accepted: clearly the ctor is not private
return a.x;
}
EOF
g++ -c -Wctor-dtor-privacy foo.cpp
foo.cpp:1: warning: 'class A' only defines private constructors and has no friends
This occurs in 4.0.0 and is a regression from 3.3.5 and 3.4.3.
--
Summary: spurious warning with -Wctor-dtor-privacy
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bh at techhouse dot brown dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21347