public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67574] New: Misleading error message for method explicitly defaulted two times
@ 2015-09-14 13:42 arvo at me dot com
  2021-08-09 20:51 ` [Bug c++/67574] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: arvo at me dot com @ 2015-09-14 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67574
           Summary: Misleading error message for method explicitly
                    defaulted two times
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arvo at me dot com
  Target Milestone: ---

Created attachment 36334
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36334&action=edit
Minimal test program (no headers/macros)

g++ (Ubuntu 5.1.1-4ubuntu12) 5.1.1 20150504
x86_64 GNU/Linux
Ubuntu 15.04
Command line: g++ -c -std=c++11 redefaulted.cxx

Compiling the attached test program results in the following diagnostic:
redefaulted.cxx:7:1: error: definition of explicitly-defaulted ‘X::X()’
 X::X() = default;
 ^
redefaulted.cxx:1:8: error: ‘X::X()’ explicitly defaulted here
 struct X
        ^

This is misleading as X::X() was first defined (and explicitly defaulted) in
line 6, not line 1, and not even in the struct definition.
>From gcc-bugs-return-497189-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Sep 14 13:46:51 2015
Return-Path: <gcc-bugs-return-497189-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 46261 invoked by alias); 14 Sep 2015 13:46:51 -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 46195 invoked by uid 55); 14 Sep 2015 13:46:46 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/67061] sh64-elf: internal compiler error: in sh_find_set_of_reg, at config/sh/sh-protos.h:235
Date: Mon, 14 Sep 2015 13:46: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: 5.2.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
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:
Message-ID: <bug-67061-4-UesnrtMKsr@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67061-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67061-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-09/txt/msg01167.txt.bz2
Content-length: 454

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

--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Author: olegendo
Date: Mon Sep 14 13:46:14 2015
New Revision: 227750

URL: https://gcc.gnu.org/viewcvs?rev"7750&root=gcc&view=rev
Log:
gcc/
        PR target/67061
        * config/sh/sh-protos.h (sh_find_set_of_reg): Simplfiy for-loop.
        Handle call insns.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sh/sh-protos.h


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

* [Bug c++/67574] Misleading error message for method explicitly defaulted two times
  2015-09-14 13:42 [Bug c++/67574] New: Misleading error message for method explicitly defaulted two times arvo at me dot com
@ 2021-08-09 20:51 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-09 20:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The location was fixed in GCC 10+:
<source>:7:1: error: definition of explicitly-defaulted 'X::X()'
    7 | X::X() = default;
      | ^
<source>:6:1: note: 'X::X()' explicitly defaulted here
    6 | X::X() = default;
      | ^

Is that enough to fix this issue?

Note here is clang produces:
<source>:7:4: error: redefinition of 'X'
X::X() = default;
   ^
<source>:6:4: note: previous definition is here
X::X() = default;
   ^

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

end of thread, other threads:[~2021-08-09 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-14 13:42 [Bug c++/67574] New: Misleading error message for method explicitly defaulted two times arvo at me dot com
2021-08-09 20:51 ` [Bug c++/67574] " pinskia 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).