public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "roland at gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/54055] New: spurious(?) "invalid use of incomplete type" warning in template definition
Date: Fri, 20 Jul 2012 18:38:00 -0000	[thread overview]
Message-ID: <bug-54055-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54055

             Bug #: 54055
           Summary: spurious(?) "invalid use of incomplete type" warning
                    in template definition
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: roland@gnu.org


Created attachment 27847
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27847
test case, C++ source

The attached input file is culled from Chromium sources.  Past versions of
GCC do not complain about this and nor does Clang.  Trunk G++ started
giving a warning fairly recently (sometime after I left for Prague).
It happens with no special options, and also with -std=gnu++98; I didn't
test other modes.

foo.cc:3:35: warning: invalid use of incomplete type ‘class scoped_ptr<C>’
[enabled by default]
   private: struct RValue : public scoped_ptr { RValue(); ~RValue();
RValue(cons
                                   ^
foo.cc:2:7: warning: declaration of ‘class scoped_ptr<C>’ [enabled by default]
 class scoped_ptr {
       ^

This code pattern comes from using the macro MOVE_ONLY_TYPE_FOR_CPP_03
as defined here:
    http://src.chromium.org/viewvc/chrome/trunk/src/base/move.h?view=markup

Is this code really invalid C++?  If so, was it intended to start rejecting
it without any new -std= or -Wfoo options when G++ never did before?


             reply	other threads:[~2012-07-20 18:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 18:38 roland at gnu dot org [this message]
2012-07-20 19:18 ` [Bug c++/54055] " daniel.kruegler at googlemail dot com
2012-07-20 19:26 ` redi at gcc dot gnu.org
2012-07-21 14:11 ` jason at gcc dot gnu.org
2012-07-22 11:27 ` paolo.carlini at oracle dot com

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=bug-54055-4@http.gcc.gnu.org/bugzilla/ \
    --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).