public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-12 11:58 ` jakub at gcc dot gnu.org
2020-03-26 15:11 ` barry.revzin at gmail dot com
` (8 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-12 11:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.3 |9.4
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 9.3.0 has been released, adjusting target milestone.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete jakub at gcc dot gnu.org
@ 2020-03-26 15:11 ` barry.revzin at gmail dot com
2020-04-23 22:37 ` redi at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: barry.revzin at gmail dot com @ 2020-03-26 15:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Barry Revzin <barry.revzin at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |barry.revzin at gmail dot com
--- Comment #11 from Barry Revzin <barry.revzin at gmail dot com> ---
Here's an interesting reduction:
#include <type_traits>
struct any {
any();
any(any const&);
template <class ValueType
, class Tp = std::decay_t<ValueType>
, class = std::enable_if_t<
!std::is_same<Tp, any>::value
&& std::is_copy_constructible<Tp>::value
#ifdef LIBSTDCXX
&& std::is_constructible<Tp, ValueType>::value
#endif
>
>
any(ValueType&& value);
};
struct X {
X(X const&);
X(any);
};
static_assert(std::is_copy_constructible_v<X>);
This compiles fine, fails if you add -DLIBSTDCXX. I laid it out this way
because libstdc++ has that check but libc++ doesn't. Although, this is
especially weird because in this program, there is only one instantiation of
any's constructor template and it's with ValueType=X const&, which means that
we're checking is_copy_constructible<X> && is_constructible<X, X const&>...
which should be identical and yet are somehow not.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete jakub at gcc dot gnu.org
2020-03-26 15:11 ` barry.revzin at gmail dot com
@ 2020-04-23 22:37 ` redi at gcc dot gnu.org
2020-04-24 0:01 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2020-04-23 22:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |alabuzhev at gmail dot com
--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 91630 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2020-04-23 22:37 ` redi at gcc dot gnu.org
@ 2020-04-24 0:01 ` cvs-commit at gcc dot gnu.org
2020-04-24 0:06 ` [Bug libstdc++/90415] [9 " redi at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-24 0:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:d1462b0782555354b4480e1f46498586d5882972
commit r10-7935-gd1462b0782555354b4480e1f46498586d5882972
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Apr 24 00:54:20 2020 +0100
libstdc++: Fix constructor constraints for std::any (PR 90415)
This removes a non-standard extension to std::any which causes errors
for valid code, due to recursive instantiation of a trait that isn't
supposed to be in the constraints.
It also removes some incorrect constraints on the in_place_type<T>
constructors and emplace members, which were preventing creating a
std::any object with another std::any as the contained value.
2020-04-24 Kamlesh Kumar <kamleshbhalui@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/90415
PR libstdc++/92156
* include/std/any (any): Rename template parameters for consistency
with the standard.
(any::_Decay): Rename to _Decay_if_not_any.
(any::any(T&&):: Remove is_constructible from constraints. Remove
non-standard overload.
(any::any(in_place_type_t<T>, Args&&...))
(any::any(in_place_type_t<T>, initializer_list<U>, Args&&...))
(any::emplace(Args&&...))
(any::emplace(initializer_list<U>, Args&&...)):
Use decay_t instead of _Decay.
* testsuite/20_util/any/cons/90415.cc: New test.
* testsuite/20_util/any/cons/92156.cc: New Test.
* testsuite/20_util/any/misc/any_cast_neg.cc: Make dg-error
directives
more robust.
* testsuite/20_util/any/modifiers/92156.cc: New test.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2020-04-24 0:01 ` cvs-commit at gcc dot gnu.org
@ 2020-04-24 0:06 ` redi at gcc dot gnu.org
2020-07-23 22:23 ` familiebaumanns at gmail dot com
` (4 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2020-04-24 0:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10 Regression] |[9 Regression]
|std::is_copy_constructible< |std::is_copy_constructible<
|std::tuple<std::any>> is |std::tuple<std::any>> is
|incomplete |incomplete
--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed on master so far, backport to follow soon.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2020-04-24 0:06 ` [Bug libstdc++/90415] [9 " redi at gcc dot gnu.org
@ 2020-07-23 22:23 ` familiebaumanns at gmail dot com
2021-04-19 10:40 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: familiebaumanns at gmail dot com @ 2020-07-23 22:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Bernd Baumanns <familiebaumanns at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |familiebaumanns at gmail dot com
--- Comment #15 from Bernd Baumanns <familiebaumanns at gmail dot com> ---
I have nearly the same issue (g++ compiles fine, but clang++ not). Not with
std::any as tuple argument, but some references to other tuple types.
I "solved" it, by using my own std::is_copy_constructible.
using my_is_copy_constructible = std::is_constructible_v<T,
std::add_lvalue_reference_t<const T>>;
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2020-07-23 22:23 ` familiebaumanns at gmail dot com
@ 2021-04-19 10:40 ` redi at gcc dot gnu.org
2021-06-01 8:14 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-19 10:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
Assignee|redi at gcc dot gnu.org |unassigned at gcc dot gnu.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2021-04-19 10:40 ` redi at gcc dot gnu.org
@ 2021-06-01 8:14 ` rguenth at gcc dot gnu.org
2021-07-22 21:28 ` cvs-commit at gcc dot gnu.org
2021-07-22 21:31 ` redi at gcc dot gnu.org
9 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01 8:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.4 |9.5
--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2021-06-01 8:14 ` rguenth at gcc dot gnu.org
@ 2021-07-22 21:28 ` cvs-commit at gcc dot gnu.org
2021-07-22 21:31 ` redi at gcc dot gnu.org
9 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-22 21:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:
https://gcc.gnu.org/g:14597b680a24b6f7375e4470dea935da9c369feb
commit r9-9638-g14597b680a24b6f7375e4470dea935da9c369feb
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Apr 24 00:54:20 2020 +0100
libstdc++: Fix constructor constraints for std::any (PR 90415)
This removes a non-standard extension to std::any which causes errors
for valid code, due to recursive instantiation of a trait that isn't
supposed to be in the constraints.
It also removes some incorrect constraints on the in_place_type<T>
constructors and emplace members, which were preventing creating a
std::any object with another std::any as the contained value.
2020-04-24 Kamlesh Kumar <kamleshbhalui@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/90415
PR libstdc++/92156
* include/std/any (any): Rename template parameters for consistency
with the standard.
(any::_Decay): Rename to _Decay_if_not_any.
(any::any(T&&)): Remove is_constructible from constraints. Remove
non-standard overload.
(any::any(in_place_type_t<T>, Args&&...))
(any::any(in_place_type_t<T>, initializer_list<U>, Args&&...))
(any::emplace(Args&&...))
(any::emplace(initializer_list<U>, Args&&...)):
Use decay_t instead of _Decay.
* testsuite/20_util/any/cons/90415.cc: New test.
* testsuite/20_util/any/cons/92156.cc: New Test.
* testsuite/20_util/any/misc/any_cast_neg.cc: Make dg-error
directives
more robust.
* testsuite/20_util/any/modifiers/92156.cc: New test.
(cherry picked from commit d1462b0782555354b4480e1f46498586d5882972)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/90415] [9 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
` (8 preceding siblings ...)
2021-07-22 21:28 ` cvs-commit at gcc dot gnu.org
@ 2021-07-22 21:31 ` redi at gcc dot gnu.org
9 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2021-07-22 21:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for 9.5 too.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-07-22 21:31 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-90415-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible<std::tuple<std::any>> is incomplete jakub at gcc dot gnu.org
2020-03-26 15:11 ` barry.revzin at gmail dot com
2020-04-23 22:37 ` redi at gcc dot gnu.org
2020-04-24 0:01 ` cvs-commit at gcc dot gnu.org
2020-04-24 0:06 ` [Bug libstdc++/90415] [9 " redi at gcc dot gnu.org
2020-07-23 22:23 ` familiebaumanns at gmail dot com
2021-04-19 10:40 ` redi at gcc dot gnu.org
2021-06-01 8:14 ` rguenth at gcc dot gnu.org
2021-07-22 21:28 ` cvs-commit at gcc dot gnu.org
2021-07-22 21:31 ` redi 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).