public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60284] New: Default-initialization without user-provided constructor allowed
@ 2014-02-20  8:52 potswa at mac dot com
  2014-02-20  9:20 ` [Bug c++/60284] [DR 253] " redi at gcc dot gnu.org
  2024-04-04  0:20 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: potswa at mac dot com @ 2014-02-20  8:52 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3085 bytes --]

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

            Bug ID: 60284
           Summary: Default-initialization without user-provided
                    constructor allowed
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: potswa at mac dot com

This declaration is ill-formed according to the last sentence of [dcl.init]
§8.5/7, "If a program calls for the default initialization of an object of a
const-qualified type T, T shall be a class type with a user-provided default
constructor":

struct a {} const o;

There is actually a very nice diagnostic implemented by r179170 and PR42844,
but it's only activated when the class has an uninitialized member, per the
notes of CWG DR 253. However those notes aren't normative and Clang diagnoses
the error, http://stackoverflow.com/q/21900237/153285 .
>From gcc-bugs-return-444309-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 20 08:53:43 2014
Return-Path: <gcc-bugs-return-444309-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10897 invoked by alias); 20 Feb 2014 08:53:43 -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 10872 invoked by uid 48); 20 Feb 2014 08:53:39 -0000
From: "petr.kmoch at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/60285] std::list<T>::insert(position, x) does not accept const_iterator position
Date: Thu, 20 Feb 2014 08:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: petr.kmoch at gmail dot com
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: attachments.created
Message-ID: <bug-60285-4-YJX8nUcXeU@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60285-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60285-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-02/txt/msg02066.txt.bz2
Content-length: 250

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`285

--- Comment #1 from Petr Kmoch <petr.kmoch at gmail dot com> ---
Created attachment 32177
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id2177&actioníit
gcc -v output when building test case


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

* [Bug c++/60284] [DR 253] Default-initialization without user-provided constructor allowed
  2014-02-20  8:52 [Bug c++/60284] New: Default-initialization without user-provided constructor allowed potswa at mac dot com
@ 2014-02-20  9:20 ` redi at gcc dot gnu.org
  2024-04-04  0:20 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2014-02-20  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2014-02-20
            Summary|Default-initialization      |[DR 253]
                   |without user-provided       |Default-initialization
                   |constructor allowed         |without user-provided
                   |                            |constructor allowed
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is by design, because as DR 253 shows, the normative standard is flawed.


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

* [Bug c++/60284] [DR 253] Default-initialization without user-provided constructor allowed
  2014-02-20  8:52 [Bug c++/60284] New: Default-initialization without user-provided constructor allowed potswa at mac dot com
  2014-02-20  9:20 ` [Bug c++/60284] [DR 253] " redi at gcc dot gnu.org
@ 2024-04-04  0:20 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-04  0:20 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
From cwg253
(https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#253):
[Adopted at the November, 2016 meeting as part of paper P0490R0.]


But I can't tell if it was a adopted as a defect report or just implemented as
part of C++17.

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

end of thread, other threads:[~2024-04-04  0:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20  8:52 [Bug c++/60284] New: Default-initialization without user-provided constructor allowed potswa at mac dot com
2014-02-20  9:20 ` [Bug c++/60284] [DR 253] " redi at gcc dot gnu.org
2024-04-04  0:20 ` 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).