* [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
* [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 ` [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
` (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
` (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
` (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
` (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
` (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
` (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
` (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
` (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
` (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
` (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