[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2017-10-20 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

Ville Voutilainen  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Ville Voutilainen  ---
Not backporting, closing.

[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2017-05-17 Thread ville at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

--- Comment #6 from ville at gcc dot gnu.org ---
Author: ville
Date: Wed May 17 13:54:23 2017
New Revision: 248153

URL: https://gcc.gnu.org/viewcvs?rev=248153=gcc=rev
Log:
Implement new C++ intrinsics __is_assignable and __is_constructible.

c-family/

Implement new C++ intrinsics __is_assignable and __is_constructible.
* c-common.c (__is_assignable, __is_constructible): New.
* c-common.h (RID_IS_ASSIGNABLE, RID_IS_CONSTRUCTIBLE): Likewise.

cp/

PR c++/80654
PR c++/80682
Implement new C++ intrinsics __is_assignable and __is_constructible.
* cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
(is_xible): New.
* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
* method.c (constructible_expr): Set cp_unevaluated.
(is_xible_helper): New.
(is_trivially_xible): Adjust.
(is_xible): New.
* parser.c (cp_parser_primary_expression): Handle
RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
(cp_parser_trait_expr): Likewise.
* semantics.c (trait_expr_value): Handle
CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.

testsuite/

* g++.dg/ext/80654.C: New.

libstdc++-v3/

Implement new C++ intrinsics __is_assignable and __is_constructible.
* include/std/type_traits (__do_is_static_castable_impl): Remove.
(__is_static_castable_impl, __is_static_castable_safe): Likewise.
(__is_static_castable, __do_is_direct_constructible_impl): Likewise.
(__is_direct_constructible_impl): Likewise.
(__is_direct_constructible_new_safe): Likewise.
(__is_base_to_derived_ref, __is_lvalue_to_rvalue_ref): Likewise.
(__is_direct_constructible_ref_cast): Likewise.
(__is_direct_constructible_new, __is_direct_constructible): Likewise.
(__do_is_nary_constructible_impl): Likewise.
(__is_nary_constructible_impl, __is_nary_constructible): Likewise.
(__is_constructible_impl): Likewise.
(is_constructible): Call the intrinsic.
(__is_assignable_helper): Remove.
(is_assignable): Call the intrinsic.
(is_trivially_constructible): Likewise.
(__is_trivially_copy_constructible_impl): New.
(is_trivially_copy_constructible): Use it.
(__is_trivially_move_constructible_impl): New.
(is_trivially_move_constructible): Use it.
(is_trivially_assignable): Call the intrinsic.
(__is_trivially_copy_assignable_impl): New.
(is_trivially_copy_assignable): Use it.
(__is_trivially_move_assignable_impl): New.
(is_trivially_move_assignable): Use it.
(testsuite/20_util/declval/requirements/1_neg.cc): Adjust.
(testsuite/20_util/is_trivially_copy_assignable/value.cc):
Add test for void.
(testsuite/20_util/is_trivially_copy_constructible/value.cc): Likewise.
(testsuite/20_util/is_trivially_move_assignable/value.cc): Likewise.
(testsuite/20_util/is_trivially_move_constructible/value.cc): Likewise.
(testsuite/20_util/make_signed/requirements/typedefs_neg.cc): Adjust.
(testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc):
Likewise.

Added:
trunk/gcc/testsuite/g++.dg/ext/80654.C
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/c-family/c-common.h
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/cxx-pretty-print.c
trunk/gcc/cp/method.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/semantics.c
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/type_traits
trunk/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
trunk/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/value.cc
   
trunk/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/value.cc
trunk/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/value.cc
   
trunk/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/value.cc
   
trunk/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
   
trunk/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc

[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2017-05-11 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

--- Comment #5 from Ville Voutilainen  ---
This patch doesn't fully provide the means for a library implementation to just
call the intrinsic from the library trait. I have
a patch that does, which I'm testing.

[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2017-05-11 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

--- Comment #4 from Ville Voutilainen  ---
Fixed on trunk thus far. Backporting in a couple of days.

[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2017-05-11 Thread ville at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

--- Comment #3 from ville at gcc dot gnu.org ---
Author: ville
Date: Thu May 11 07:44:29 2017
New Revision: 247880

URL: https://gcc.gnu.org/viewcvs?rev=247880=gcc=rev
Log:
PR c++/80682

cp/

PR c++/80682
* method.c (is_trivially_xible): Reject void types.

testsuite/

PR c++/80682
* g++.dg/ext/is_trivially_constructible1.C: Add tests for void target.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/method.c
trunk/gcc/testsuite/g++.dg/ext/is_trivially_constructible1.C

[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2017-05-09 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

--- Comment #2 from Ville Voutilainen  ---
Initial patch: https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00632.html

[Bug c++/80682] __is_trivially_constructible(void, int) returns true.

2017-05-09 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80682

Ville Voutilainen  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-05-09
   Assignee|unassigned at gcc dot gnu.org  |ville.voutilainen at 
gmail dot com
 Ever confirmed|0   |1

--- Comment #1 from Ville Voutilainen  ---
I'll see what I can do. is_trivially_xible seems to return true here, dunno why
yet. I'll debug it. Chances are we merely need to treat void specially in that
function, because the functions it calls that check for conversions and
standard conversions are fine as is, because they have other callers and int is
certainly convertible to void.