public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
       [not found] <bug-42844-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-12 15:37 ` fabien.chene at gmail dot com
  2011-09-23 21:36 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: fabien.chene at gmail dot com @ 2010-11-12 15:37 UTC (permalink / raw)
  To: gcc-bugs

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

Fabien Chene <fabien.chene at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
      Known to fail|                            |

--- Comment #14 from Fabien Chene <fabien.chene at gmail dot com> 2010-11-12 14:27:36 UTC ---
Fixed.


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
       [not found] <bug-42844-4@http.gcc.gnu.org/bugzilla/>
  2010-11-12 15:37 ` [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor fabien.chene at gmail dot com
@ 2011-09-23 21:36 ` jason at gcc dot gnu.org
  2011-09-25 20:37 ` jason at gcc dot gnu.org
  2014-02-20  8:44 ` potswa at mac dot com
  3 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-23 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-23 21:30:52 UTC ---
Author: jason
Date: Fri Sep 23 21:30:48 2011
New Revision: 179130

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179130
Log:
    Core 234 - allow const objects with no initializer or
    user-provided default constructor if the defaulted constructor
    initializes all the subobjects.
    PR c++/20039
    PR c++/42844
    * class.c (default_init_uninitialized_part): New.
    * cp-tree.h: Declare it.
    * decl.c (check_for_uninitialized_const_var): Use it.
    * init.c (perform_member_init): Likewise.
    (build_new_1): Likewise.
    * method.c (walk_field_subobs): Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/init/const8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/init.c
    trunk/gcc/cp/method.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
    trunk/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
    trunk/gcc/testsuite/g++.dg/init/pr20039.C
    trunk/gcc/testsuite/g++.dg/init/pr42844.C


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
       [not found] <bug-42844-4@http.gcc.gnu.org/bugzilla/>
  2010-11-12 15:37 ` [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor fabien.chene at gmail dot com
  2011-09-23 21:36 ` jason at gcc dot gnu.org
@ 2011-09-25 20:37 ` jason at gcc dot gnu.org
  2014-02-20  8:44 ` potswa at mac dot com
  3 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-25 20:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-25 20:29:09 UTC ---
Author: jason
Date: Sun Sep 25 20:29:04 2011
New Revision: 179170

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179170
Log:
    Core 234 - allow const objects with no initializer or
    user-provided default constructor if the defaulted constructor
    initializes all the subobjects.
    PR c++/20039
    PR c++/42844
    * class.c (default_init_uninitialized_part): New.
    * cp-tree.h: Declare it.
    * decl.c (check_for_uninitialized_const_var): Use it.
    * init.c (perform_member_init): Likewise.
    (build_new_1): Likewise.
    * method.c (walk_field_subobs): Likewise.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/init/const8.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/class.c
    branches/gcc-4_6-branch/gcc/cp/cp-tree.h
    branches/gcc-4_6-branch/gcc/cp/decl.c
    branches/gcc-4_6-branch/gcc/cp/init.c
    branches/gcc-4_6-branch/gcc/cp/method.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/init/pr42844.C
    branches/gcc-4_6-branch/gcc/testsuite/lib/prune.exp


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
       [not found] <bug-42844-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-09-25 20:37 ` jason at gcc dot gnu.org
@ 2014-02-20  8:44 ` potswa at mac dot com
  3 siblings, 0 replies; 17+ messages in thread
From: potswa at mac dot com @ 2014-02-20  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

David Krauss <potswa at mac dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |potswa at mac dot com

--- Comment #17 from David Krauss <potswa at mac dot com> ---
The changelog should refer to CWG DR 253, not 234.


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (11 preceding siblings ...)
  2010-04-20 22:49 ` fabien dot chene at gmail dot com
@ 2010-04-27 18:56 ` jason at gcc dot gnu dot org
  12 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-04-27 18:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jason at gcc dot gnu dot org  2010-04-27 18:56 -------
Subject: Bug 42844

Author: jason
Date: Tue Apr 27 18:56:13 2010
New Revision: 158797

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158797
Log:
        PR c++/42844
        * decl.c (check_for_uninitialized_const_var): Handle classes that need
        constructing, too.
        (check_initializer): Call it for classes that need constructing, too.
        * class.c (in_class_defaulted_default_constructor): New.
        * cp-tree.h: Declare it.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
    trunk/gcc/testsuite/g++.dg/init/pr42844.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
    trunk/gcc/testsuite/g++.dg/tree-ssa/pr27549.C
    trunk/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/src/future.cc
    trunk/libstdc++-v3/src/system_error.cc
    trunk/libstdc++-v3/testsuite/util/testsuite_error.h


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (10 preceding siblings ...)
  2010-04-12 20:45 ` fabien dot chene at gmail dot com
@ 2010-04-20 22:49 ` fabien dot chene at gmail dot com
  2010-04-27 18:56 ` jason at gcc dot gnu dot org
  12 siblings, 0 replies; 17+ messages in thread
From: fabien dot chene at gmail dot com @ 2010-04-20 22:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from fabien dot chene at gmail dot com  2010-04-20 22:49 -------
updated patch here:
http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01148.html


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (9 preceding siblings ...)
  2010-03-30 16:47 ` fabien dot chene at gmail dot com
@ 2010-04-12 20:45 ` fabien dot chene at gmail dot com
  2010-04-20 22:49 ` fabien dot chene at gmail dot com
  2010-04-27 18:56 ` jason at gcc dot gnu dot org
  12 siblings, 0 replies; 17+ messages in thread
From: fabien dot chene at gmail dot com @ 2010-04-12 20:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from fabien dot chene at gmail dot com  2010-04-12 20:45 -------
Patch here:
http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00604.html


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (8 preceding siblings ...)
  2010-03-30 14:11 ` fabien dot chene at gmail dot com
@ 2010-03-30 16:47 ` fabien dot chene at gmail dot com
  2010-04-12 20:45 ` fabien dot chene at gmail dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: fabien dot chene at gmail dot com @ 2010-03-30 16:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from fabien dot chene at gmail dot com  2010-03-30 16:47 -------
> reduced testcase for this one:
> 
> struct A {};
> 
> void f()
> {
>   A const a;
> }

I misspoke, let's keep the original testcase.


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (7 preceding siblings ...)
  2010-03-30 11:56 ` redi at gcc dot gnu dot org
@ 2010-03-30 14:11 ` fabien dot chene at gmail dot com
  2010-03-30 16:47 ` fabien dot chene at gmail dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: fabien dot chene at gmail dot com @ 2010-03-30 14:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from fabien dot chene at gmail dot com  2010-03-30 14:11 -------
(In reply to comment #8)
> you should have the option "Accept bug" below the comment box.  
> I've done it for you

I've just seen it since you did it for me (thanks), but I still can't do it by
myself for other bugs :-(

reduced testcase for this one:

struct A {};

void f()
{
  A const a;
}


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (6 preceding siblings ...)
  2010-03-30 11:51 ` fabien dot chene at gmail dot com
@ 2010-03-30 11:56 ` redi at gcc dot gnu dot org
  2010-03-30 14:11 ` fabien dot chene at gmail dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-03-30 11:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from redi at gcc dot gnu dot org  2010-03-30 11:56 -------
you should have the option "Accept bug" below the comment box.  I've done it
for you


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fabien dot chene at gmail
                   |dot org                     |dot com
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (5 preceding siblings ...)
  2010-03-30 11:44 ` dodji at redhat dot com
@ 2010-03-30 11:51 ` fabien dot chene at gmail dot com
  2010-03-30 11:56 ` redi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: fabien dot chene at gmail dot com @ 2010-03-30 11:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from fabien dot chene at gmail dot com  2010-03-30 11:51 -------
(In reply to comment #6)
> Subject: Re:  const variable requires initializer / no
>  explicitly declared default constructor
> 
> > I'm working on this bug
> 
> Could you please assign it to yourself then?
> Thanks.

I would be glad to know how to do that :-)


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (4 preceding siblings ...)
  2010-03-30 11:40 ` fabien dot chene at gmail dot com
@ 2010-03-30 11:44 ` dodji at redhat dot com
  2010-03-30 11:51 ` fabien dot chene at gmail dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: dodji at redhat dot com @ 2010-03-30 11:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dodji at gcc dot gnu dot org  2010-03-30 11:44 -------
Subject: Re:  const variable requires initializer / no
 explicitly declared default constructor

> I'm working on this bug

Could you please assign it to yourself then?
Thanks.


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (3 preceding siblings ...)
  2010-01-22 15:57 ` pinskia at gcc dot gnu dot org
@ 2010-03-30 11:40 ` fabien dot chene at gmail dot com
  2010-03-30 11:44 ` dodji at redhat dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: fabien dot chene at gmail dot com @ 2010-03-30 11:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from fabien dot chene at gmail dot com  2010-03-30 11:40 -------
I'm working on this bug


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
                   ` (2 preceding siblings ...)
  2010-01-22 15:56 ` pinskia at gcc dot gnu dot org
@ 2010-01-22 15:57 ` pinskia at gcc dot gnu dot org
  2010-03-30 11:40 ` fabien dot chene at gmail dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-01-22 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2010-01-22 15:56 -------
And PR 29043.


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
  2010-01-22 11:57 ` [Bug c++/42844] " redi at gcc dot gnu dot org
  2010-01-22 12:27 ` redi at gcc dot gnu dot org
@ 2010-01-22 15:56 ` pinskia at gcc dot gnu dot org
  2010-01-22 15:57 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-01-22 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2010-01-22 15:56 -------
Related to PR 25811.


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
  2010-01-22 11:57 ` [Bug c++/42844] " redi at gcc dot gnu dot org
@ 2010-01-22 12:27 ` redi at gcc dot gnu dot org
  2010-01-22 15:56 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-01-22 12:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from redi at gcc dot gnu dot org  2010-01-22 12:27 -------
N.B. the wording has moved in C++0x but the requirement is similar:

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

11 If no initializer is specified for an object, the object is
default-initialized;


-- 


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


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

* [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor
  2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
@ 2010-01-22 11:57 ` redi at gcc dot gnu dot org
  2010-01-22 12:27 ` redi at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-01-22 11:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from redi at gcc dot gnu dot org  2010-01-22 11:57 -------
Confirmed, not a regression.

[dcl.init]/9:
If no initializer is specified for an object, and the object is of (possibly
cv-qualified) non-POD class type (or array thereof), the object shall be
default-initialized; if the object is of const-qualified type, the underlying
class type shall have a user-declared default constructor.


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid
      Known to fail|                            |4.1.2 4.4.2
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-22 11:57:37
               date|                            |


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


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

end of thread, other threads:[~2014-02-20  8:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-42844-4@http.gcc.gnu.org/bugzilla/>
2010-11-12 15:37 ` [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor fabien.chene at gmail dot com
2011-09-23 21:36 ` jason at gcc dot gnu.org
2011-09-25 20:37 ` jason at gcc dot gnu.org
2014-02-20  8:44 ` potswa at mac dot com
2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
2010-01-22 11:57 ` [Bug c++/42844] " redi at gcc dot gnu dot org
2010-01-22 12:27 ` redi at gcc dot gnu dot org
2010-01-22 15:56 ` pinskia at gcc dot gnu dot org
2010-01-22 15:57 ` pinskia at gcc dot gnu dot org
2010-03-30 11:40 ` fabien dot chene at gmail dot com
2010-03-30 11:44 ` dodji at redhat dot com
2010-03-30 11:51 ` fabien dot chene at gmail dot com
2010-03-30 11:56 ` redi at gcc dot gnu dot org
2010-03-30 14:11 ` fabien dot chene at gmail dot com
2010-03-30 16:47 ` fabien dot chene at gmail dot com
2010-04-12 20:45 ` fabien dot chene at gmail dot com
2010-04-20 22:49 ` fabien dot chene at gmail dot com
2010-04-27 18:56 ` jason at gcc dot gnu dot 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).