Commit e81c8328 by Ville Voutilainen Committed by Ville Voutilainen

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
parent 687aed9c
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> 2017-05-10 Nathan Sidwell <nathan@acm.org>
* class.c (handle_using_decl): Always use OVL_CURRENT. * class.c (handle_using_decl): Always use OVL_CURRENT.
......
...@@ -1207,6 +1207,8 @@ constructible_expr (tree to, tree from) ...@@ -1207,6 +1207,8 @@ constructible_expr (tree to, tree from)
bool bool
is_trivially_xible (enum tree_code code, tree to, tree from) is_trivially_xible (enum tree_code code, tree to, tree from)
{ {
if (VOID_TYPE_P (to))
return false;
tree expr; tree expr;
if (code == MODIFY_EXPR) if (code == MODIFY_EXPR)
expr = assignable_expr (to, from); expr = assignable_expr (to, from);
......
...@@ -27,10 +27,18 @@ SA(!__is_trivially_constructible(C,C&)); ...@@ -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(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,int));
SA(__is_trivially_constructible(int,double)); SA(__is_trivially_constructible(int,double));
SA(!__is_trivially_constructible(int,B)); 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)); SA(!__is_trivially_constructible(D));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment