Commit 75bda2e8 by Ville Voutilainen Committed by Jason Merrill

re PR c++/63959 (G++ misreports volatile int as trivially copyable)

	PR c++/63959
	* tree.c (trivially_copyable_p): Check for CP_TYPE_VOLATILE_P.

From-SVN: r217893
parent e7ea1475
2014-11-20 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/63959
* tree.c (trivially_copyable_p): Check for CP_TYPE_VOLATILE_P.
2014-11-20 Trevor Saunders <tsaunders@mozilla.com>
* cp-objcp-common.c: Use hash_table instead of htab.
......
......@@ -3206,7 +3206,7 @@ trivially_copyable_p (const_tree t)
&& !TYPE_HAS_COMPLEX_MOVE_ASSIGN (t)
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (t));
else
return scalarish_type_p (t);
return !CP_TYPE_VOLATILE_P (t) && scalarish_type_p (t);
}
/* Returns 1 iff type T is a trivial type, as defined in [basic.types] and
......
......@@ -33,3 +33,6 @@ SA(__is_trivially_constructible(int,double));
SA(!__is_trivially_constructible(int,B));
SA(!__is_trivially_constructible(D));
SA(__is_trivially_copyable(int));
SA(!__is_trivially_copyable(volatile int));
......@@ -47,6 +47,8 @@ void test01()
static_assert(test_property<is_trivially_copyable,
int>(true), "");
static_assert(test_property<is_trivially_copyable,
volatile int>(false), "");
static_assert(test_property<is_trivially_copyable,
TType>(true), "");
static_assert(test_property<is_trivially_copyable,
......
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