public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13981] New: Give message about incomplete class that might be implicitly upcasted.
@ 2004-02-02 15:30 mattyt-bugzilla at tpg dot com dot au
  2004-02-02 15:33 ` [Bug c++/13981] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 7+ messages in thread
From: mattyt-bugzilla at tpg dot com dot au @ 2004-02-02 15:30 UTC (permalink / raw)
  To: gcc-bugs

The code:

struct A {};
struct B;

void func( A* a );

int main(int argc, char *argv[]) {
	B *b = 0;
	func(b);
};

gives the error message:

upcast.cc: In function `int main(int, char**)':
upcast.cc:8: error: cannot convert `B*' to `A*' for argument `1' to `void func(A*)'

which is correct.

However in other places gcc will tell you when you've tried to do something with
an incomplete type which might have succeeded if it was complete.  It would be
nice if it could do it here, since B might be a subclass of A.

This should be just a simple matter of adding "[B is incomplete]" to the end of
the error message or something.

-- 
           Summary: Give message about incomplete class that might be
                    implicitly upcasted.
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mattyt-bugzilla at tpg dot com dot au
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-05-08 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-13981-4@http.gcc.gnu.org/bugzilla/>
2013-08-27 11:39 ` [Bug c++/13981] Give message about incomplete class that might be implicitly upcasted paolo.carlini at oracle dot com
2013-10-17 16:35 ` paolo.carlini at oracle dot com
2014-05-07 16:24 ` paolo.carlini at oracle dot com
2014-05-08 11:42 ` paolo.carlini at oracle dot com
2014-05-08 14:31 ` paolo at gcc dot gnu.org
2014-05-08 14:32 ` paolo.carlini at oracle dot com
2004-02-02 15:30 [Bug c++/13981] New: " mattyt-bugzilla at tpg dot com dot au
2004-02-02 15:33 ` [Bug c++/13981] " pinskia 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).