public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66161] New: gcc silent about type incompleteness in error message
@ 2015-05-15 14:32 tromey at gcc dot gnu.org
  2015-05-15 15:32 ` [Bug c++/66161] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: tromey at gcc dot gnu.org @ 2015-05-15 14:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66161

            Bug ID: 66161
           Summary: gcc silent about type incompleteness in error message
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tromey at gcc dot gnu.org
  Target Milestone: ---

This source is distilled from a more complicated real-world
case that arose in https://bugzilla.mozilla.org/show_bug.cgi?id=1165184

class Base { };

class Incomplete; // : public Base

template<typename T>
Base* blah_cast(T *arg) { return arg; }

Base* function(Incomplete *arg)
{
  return blah_cast(arg);
}


Compiling this yields:

pokyo. g++ -c s.cc
s.cc: In instantiation of ‘Base* blah_cast(T*) [with T = Incomplete]’:
s.cc:10:23:   required from here
s.cc:6:34: error: cannot convert ‘Incomplete*’ to ‘Base*’ in return
 Base* blah_cast(T *arg) { return arg; }
                                  ^


In this case it is obvious that Incomplete is an incomplete type.
However, in the real-world code this is far from obvious.

I think it would be handy if gcc printed something like
"note: type 'Incomplete' is incomplete at this point; missing include?".
>From gcc-bugs-return-486339-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 15 14:32:13 2015
Return-Path: <gcc-bugs-return-486339-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 77685 invoked by alias); 15 May 2015 14:32:13 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 77637 invoked by uid 48); 15 May 2015 14:32:08 -0000
From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66136] AArch64 geniterators.sh relies on GNU sed syntax, causing build failure on FreeBSD and probably Mac
Date: Fri, 15 May 2015 14:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rearnsha at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-66136-4-A0ah4jKFT0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66136-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66136-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg01179.txt.bz2
Content-length: 796

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf136

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-05-15
     Ever confirmed|0                           |1

--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
According to:

http://pubs.opengroup.org/onlinepubs/009695399/utilities/sed.html

[In a replacement] the meaning of a '\' immediately followed by any character
other than '&', '\', a digit, or the delimiter character used for this command,
is unspecified.

So I think that rules out all the normal escaped characters.


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

* [Bug c++/66161] gcc silent about type incompleteness in error message
  2015-05-15 14:32 [Bug c++/66161] New: gcc silent about type incompleteness in error message tromey at gcc dot gnu.org
@ 2015-05-15 15:32 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2015-05-15 15:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66161

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE
   Target Milestone|---                         |5.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is fixed in 5.1

*** This bug has been marked as a duplicate of bug 13981 ***


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

end of thread, other threads:[~2015-05-15 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15 14:32 [Bug c++/66161] New: gcc silent about type incompleteness in error message tromey at gcc dot gnu.org
2015-05-15 15:32 ` [Bug c++/66161] " redi at gcc dot gnu.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).