re PR c++/80682 (__is_trivially_constructible(void, int) returns true.)

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.

From-SVN: r247880
This commit is contained in:
Ville Voutilainen 2017-05-11 10:44:29 +03:00 committed by Ville Voutilainen
parent 687aed9cc8
commit e81c832812
3 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/80682
* method.c (is_trivially_xible): Reject void types.
2017-05-10 Nathan Sidwell <nathan@acm.org>
* class.c (handle_using_decl): Always use OVL_CURRENT.

View File

@ -1207,6 +1207,8 @@ constructible_expr (tree to, tree from)
bool
is_trivially_xible (enum tree_code code, tree to, tree from)
{
if (VOID_TYPE_P (to))
return false;
tree expr;
if (code == MODIFY_EXPR)
expr = assignable_expr (to, from);

View File

@ -27,10 +27,18 @@ SA(!__is_trivially_constructible(C,C&));
SA(__is_trivially_assignable(C,C&));
SA(!__is_trivially_assignable(C,C));
SA(!__is_trivially_assignable(C,C&&));
SA(!__is_trivially_assignable(void,int));
SA(!__is_trivially_assignable(const void,int));
SA(!__is_trivially_assignable(volatile void,int));
SA(!__is_trivially_assignable(const volatile void,int));
SA(__is_trivially_constructible(int,int));
SA(__is_trivially_constructible(int,double));
SA(!__is_trivially_constructible(int,B));
SA(!__is_trivially_constructible(void,int));
SA(!__is_trivially_constructible(const void,int));
SA(!__is_trivially_constructible(volatile void,int));
SA(!__is_trivially_constructible(const volatile void,int));
SA(!__is_trivially_constructible(D));