public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bh at techhouse dot brown dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/21347] New: spurious warning with -Wctor-dtor-privacy
Date: Mon, 02 May 2005 21:41:00 -0000	[thread overview]
Message-ID: <20050502214022.21347.bh@techhouse.brown.edu> (raw)

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


             reply	other threads:[~2005-05-02 21:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-02 21:41 bh at techhouse dot brown dot edu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050502214022.21347.bh@techhouse.brown.edu \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).