public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21347] New: spurious warning with -Wctor-dtor-privacy
@ 2005-05-02 21:41 bh at techhouse dot brown dot edu
  2005-05-02 21:44 ` [Bug c++/21347] " bh at techhouse dot brown dot edu
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: bh at techhouse dot brown dot edu @ 2005-05-02 21:41 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <20050502214022.21347.benoit.hudson@gmail.com>]
[parent not found: <bug-21347-655@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2005-10-15 18:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02 21:41 [Bug c++/21347] New: spurious warning with -Wctor-dtor-privacy bh at techhouse dot brown dot edu
2005-05-02 21:44 ` [Bug c++/21347] " bh at techhouse dot brown dot edu
2005-05-02 21:50 ` [Bug c++/21347] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-06-26 17:42 ` pinskia at gcc dot gnu dot org
2005-07-08  1:43 ` mmitchel at gcc dot gnu dot org
     [not found] <20050502214022.21347.benoit.hudson@gmail.com>
2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-21347-655@http.gcc.gnu.org/bugzilla/>
2005-10-13 19:51 ` pinskia at gcc dot gnu dot org
2005-10-14 20:04 ` mmitchel at gcc dot gnu dot org
2005-10-15 18:09 ` cvs-commit at gcc dot gnu dot org
2005-10-15 18:13 ` cvs-commit at gcc dot gnu dot org
2005-10-15 18:13 ` mmitchel 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).