Commit 02b0c08c by Paolo Carlini Committed by Paolo Carlini

re PR c++/80991 (ICE with __is_trivially_constructible in template)

/cp
2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/80991
	* pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
	a TREE_LIST as TRAIT_EXPR_TYPE2.

/testsuite
2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/80991
	* g++.dg/ext/is_trivially_constructible5.C: New.

From-SVN: r254051
parent 5cc75a43
2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80991
* pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
a TREE_LIST as TRAIT_EXPR_TYPE2.
2017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
Paolo Carlini <paolo.carlini@oracle.com>
......
......@@ -24019,8 +24019,21 @@ value_dependent_expression_p (tree expression)
case TRAIT_EXPR:
{
tree type2 = TRAIT_EXPR_TYPE2 (expression);
return (dependent_type_p (TRAIT_EXPR_TYPE1 (expression))
|| (type2 ? dependent_type_p (type2) : false));
if (dependent_type_p (TRAIT_EXPR_TYPE1 (expression)))
return true;
if (!type2)
return false;
if (TREE_CODE (type2) != TREE_LIST)
return dependent_type_p (type2);
for (; type2; type2 = TREE_CHAIN (type2))
if (dependent_type_p (TREE_VALUE (type2)))
return true;
return false;
}
case MODOP_EXPR:
......
2017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80991
* g++.dg/ext/is_trivially_constructible5.C: New.
2017-10-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.target/i386/387-ficom-1.c: Allow for ficomp without s
......
// PR c++/80991
// { dg-do compile { target c++11 } }
template<bool> void foo()
{
static_assert(__is_trivially_constructible(int, int), "");
}
void bar()
{
foo<true>();
}
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