* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
@ 2021-09-04 13:49 ` pinskia at gcc dot gnu.org
2021-09-04 14:01 ` pinskia at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-04 13:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|libstdc++ |c++
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
THis comes down to when the struct is complete.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
2021-09-04 13:49 ` [Bug c++/102199] " pinskia at gcc dot gnu.org
@ 2021-09-04 14:01 ` pinskia at gcc dot gnu.org
2021-09-04 14:22 ` eyalroz1 at gmx dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-04 14:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is because the following is still valid C++11:
struct outer {
struct inner {
// inner() { }
unsigned int x = y;
};
static constexpr int y =10;
};
That is inner is not completed until outer is completed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
2021-09-04 13:49 ` [Bug c++/102199] " pinskia at gcc dot gnu.org
2021-09-04 14:01 ` pinskia at gcc dot gnu.org
@ 2021-09-04 14:22 ` eyalroz1 at gmx dot com
2021-09-06 15:58 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: eyalroz1 at gmx dot com @ 2021-09-04 14:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
--- Comment #3 from Eyal Rozenberg <eyalroz1 at gmx dot com> ---
Andrew: What you're saying would be plausible if g++ would find the structure
to be incomplete. It does not. The completeness check passes; and it is why
adding the explicit default ctor makes the asserting pass - despite your
rationale applying to that case just as well.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
` (2 preceding siblings ...)
2021-09-04 14:22 ` eyalroz1 at gmx dot com
@ 2021-09-06 15:58 ` redi at gcc dot gnu.org
2021-09-06 19:39 ` eyalroz1 at gmx dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2021-09-06 15:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
See PR 96645 and PR 101227
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
` (3 preceding siblings ...)
2021-09-06 15:58 ` redi at gcc dot gnu.org
@ 2021-09-06 19:39 ` eyalroz1 at gmx dot com
2021-09-06 19:54 ` eyalroz1 at gmx dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: eyalroz1 at gmx dot com @ 2021-09-06 19:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
--- Comment #5 from Eyal Rozenberg <eyalroz1 at gmx dot com> ---
(In reply to Jonathan Wakely from comment #4)
> See PR 96645 and PR 101227
Ok, I
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
` (4 preceding siblings ...)
2021-09-06 19:39 ` eyalroz1 at gmx dot com
@ 2021-09-06 19:54 ` eyalroz1 at gmx dot com
2021-09-08 10:13 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: eyalroz1 at gmx dot com @ 2021-09-06 19:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
--- Comment #6 from Eyal Rozenberg <eyalroz1 at gmx dot com> ---
(In reply to Jonathan Wakely from comment #4)
> See PR 96645 and PR 101227
Ok.
But does that explain why defining an explicit constructor cause g++ to accept
the class as default-constructible?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
` (5 preceding siblings ...)
2021-09-06 19:54 ` eyalroz1 at gmx dot com
@ 2021-09-08 10:13 ` redi at gcc dot gnu.org
2022-05-15 7:08 ` pinskia at gcc dot gnu.org
2023-12-03 21:04 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2021-09-08 10:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Because a user-provided inner() means it's default constructible, period. If
that default constructor happens to be ill-formed, that's your problem and is
outside the immediate context that is checked by is_default_constructible.
Without that user-provided constructor, the compiler has to try to implicitly
define a default constructor, which has to consider all the members and their
default member initializers, which requires the type to be complete.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
` (6 preceding siblings ...)
2021-09-08 10:13 ` redi at gcc dot gnu.org
@ 2022-05-15 7:08 ` pinskia at gcc dot gnu.org
2023-12-03 21:04 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-15 7:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mrjoel at lixil dot net
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 105606 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/102199] is_default_constructible incorrect for an inner type with NSDMI
2021-09-04 9:30 [Bug libstdc++/102199] New: is_default_constructible incorrect for an inner type with NSDMI eyalroz1 at gmx dot com
` (7 preceding siblings ...)
2022-05-15 7:08 ` pinskia at gcc dot gnu.org
@ 2023-12-03 21:04 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-03 21:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102199
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |luigighiron at gmail dot com
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112839 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 10+ messages in thread