public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59975] New: [C++11] Bogus "declared using local type ‘...’, is used but never defined"
@ 2014-01-28 23:38 ppluzhnikov at google dot com
  2015-06-15 12:01 ` [Bug c++/59975] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: ppluzhnikov at google dot com @ 2014-01-28 23:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59975
           Summary: [C++11] Bogus "declared using local type ‘...’, is
                    used but never defined"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Google ref: b/12785605

Test:

template <typename T>
struct AbstractThing {
  virtual ~AbstractThing() { }
  virtual const T* method() const = 0;
};

template <typename T>
struct ConcreteThing : public AbstractThing<T> {
  virtual ~ConcreteThing() { }
  virtual const T* method() const { return 0; }
};

int main()
{
  struct Foo { };

  AbstractThing<Foo>* concrete = new ConcreteThing<Foo>();
  int rc = (concrete->method() == 0) ? 0 : 1;
  delete concrete;
  return rc;
}


Using g++ (GCC) 4.9.0 20140128 (experimental)

g++ -std=c++11 t.cc
t.cc:4:20: error: 'const T* AbstractThing<T>::method() const [with T =
main()::Foo]', declared using local type 'const main()::Foo', is used but never
defined [-fpermissive]
   virtual const T* method() const = 0;
                    ^

Adding -fpermissive, the executable links and runs fine, so clearly the
never-defined method is not *actually* used.
>From gcc-bugs-return-441824-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jan 28 23:48:35 2014
Return-Path: <gcc-bugs-return-441824-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14997 invoked by alias); 28 Jan 2014 23:48:35 -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 14897 invoked by uid 48); 28 Jan 2014 23:48:31 -0000
From: "mh+gcc at glandium dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug gcov-profile/59973] Creates a 32GB unused bss symbol with -fprofile-generate
Date: Tue, 28 Jan 2014 23:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: gcov-profile
X-Bugzilla-Version: 4.7.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mh+gcc at glandium dot org
X-Bugzilla-Status: RESOLVED
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 resolution
Message-ID: <bug-59973-4-1hDzSYPVmv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59973-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59973-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: 2014-01/txt/msg02966.txt.bz2
Content-length: 509

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY973

Mike Hommey <mh+gcc at glandium dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Mike Hommey <mh+gcc at glandium dot org> ---
Turns out this is bug 55650.

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


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

* [Bug c++/59975] [C++11] Bogus "declared using local type ‘...’, is used but never defined"
  2014-01-28 23:38 [Bug c++/59975] New: [C++11] Bogus "declared using local type ‘...’, is used but never defined" ppluzhnikov at google dot com
@ 2015-06-15 12:01 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-06-15 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup.

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


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

end of thread, other threads:[~2015-06-15 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-28 23:38 [Bug c++/59975] New: [C++11] Bogus "declared using local type ‘...’, is used but never defined" ppluzhnikov at google dot com
2015-06-15 12:01 ` [Bug c++/59975] " paolo.carlini at oracle dot com

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).