re PR c++/63415 (internal compiler error: unexpected expression ‘static_cast<int>(std::is_same<T, A1>{})’ of kind static_cast_expr)

PR c++/63415
	* pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
	(iterative_hash_template_arg): Likewise.

From-SVN: r216043
This commit is contained in:
Jason Merrill 2014-10-09 14:05:23 -04:00 committed by Jason Merrill
parent 96e780c087
commit 5d4fffb822
3 changed files with 14 additions and 0 deletions

View file

@ -1,5 +1,9 @@
2014-10-09 Jason Merrill <jason@redhat.com>
PR c++/63415
* pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
(iterative_hash_template_arg): Likewise.
PR c++/63437
* cp-tree.h (REF_PARENTHESIZED_P): Also allow INDIRECT_REF.
* semantics.c (force_paren_expr): And set it.

View file

@ -1598,6 +1598,7 @@ iterative_hash_template_arg (tree arg, hashval_t val)
case CONSTRUCTOR:
{
tree field, value;
iterative_hash_template_arg (TREE_TYPE (arg), val);
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (arg), i, field, value)
{
val = iterative_hash_template_arg (field, val);
@ -21062,6 +21063,8 @@ value_dependent_expression_p (tree expression)
{
unsigned ix;
tree val;
if (dependent_type_p (TREE_TYPE (expression)))
return true;
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expression), ix, val)
if (value_dependent_expression_p (val))
return true;

View file

@ -0,0 +1,7 @@
// PR c++/63415
// { dg-do compile { target c++11 } }
template <typename T>
struct A {
static constexpr int value = int(T{});
};