public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "richard-gccbugzilla at metafoo dot co.uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/62310] New: fails to consider default initializers (NSDMIs) when checking inheriting constructors
Date: Fri, 29 Aug 2014 21:51:00 -0000	[thread overview]
Message-ID: <bug-62310-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 62310
           Summary: fails to consider default initializers (NSDMIs) when
                    checking inheriting constructors
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk

Consider:

struct A { A(int); A() = delete; };
struct B { B(int); B() = delete; };
struct C : B { using B::B; A a = 0; } c(0);

GCC rejects this valid code:

<stdin>:1:114: error: use of deleted function ‘C::C(int)’
<stdin>:1:97: note: ‘C::C(int)’ is implicitly deleted because the default
definition would be ill-formed:
<stdin>:1:97: error: use of deleted function ‘A::A()’
<stdin>:1:20: note: declared here

However, if you remove the '= delete' from A, GCC does in fact call A::A(int),
so this seems to be limited to determining if the inheriting constructor should
be deleted.
>From gcc-bugs-return-459537-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Aug 29 21:54:31 2014
Return-Path: <gcc-bugs-return-459537-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11268 invoked by alias); 29 Aug 2014 21:54:31 -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 11242 invoked by uid 48); 29 Aug 2014 21:54:28 -0000
From: "ettl.martin at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/62311] New: Found a potential copy and paste issue on in gcc/config/cr16.c
Date: Fri, 29 Aug 2014 21:54:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ettl.martin at gmx dot de
X-Bugzilla-Status: UNCONFIRMED
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_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-62311-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-08/txt/msg02034.txt.bz2
Content-length: 907

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

            Bug ID: 62311
           Summary: Found a potential copy and paste issue on in
                    gcc/config/cr16.c
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ettl.martin at gmx dot de

Please take a look at following suspicious code, where the same statement
appears twice in a logical or-operation:

/*file gcc/config/cr16.c, line 2027*/
static bool
cr16_frame_pointer_required (void)
{
  return (cfun->calls_alloca || crtl->calls_eh_return
      || cfun->has_nonlocal_label || crtl->calls_eh_return);
}

As you can see, the statement crtl->calls_eh_return appears twice, which looks
like a copy&paste issue.

Best regards and many thanks

Martin Ettl


             reply	other threads:[~2014-08-29 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 21:51 richard-gccbugzilla at metafoo dot co.uk [this message]
2014-08-30  0:35 ` [Bug c++/62310] " ppluzhnikov at google dot com
2014-12-13 23:50 ` ville.voutilainen at gmail dot com
2021-08-04 20:46 ` pinskia at gcc dot gnu.org

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