Commit 5d4fffb8 by Jason Merrill Committed by Jason Merrill

re PR c++/63415 (internal compiler error: unexpected expression…

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
parent 96e780c0
2014-10-09 Jason Merrill <jason@redhat.com> 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 PR c++/63437
* cp-tree.h (REF_PARENTHESIZED_P): Also allow INDIRECT_REF. * cp-tree.h (REF_PARENTHESIZED_P): Also allow INDIRECT_REF.
* semantics.c (force_paren_expr): And set it. * semantics.c (force_paren_expr): And set it.
......
...@@ -1598,6 +1598,7 @@ iterative_hash_template_arg (tree arg, hashval_t val) ...@@ -1598,6 +1598,7 @@ iterative_hash_template_arg (tree arg, hashval_t val)
case CONSTRUCTOR: case CONSTRUCTOR:
{ {
tree field, value; tree field, value;
iterative_hash_template_arg (TREE_TYPE (arg), val);
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (arg), i, field, value) FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (arg), i, field, value)
{ {
val = iterative_hash_template_arg (field, val); val = iterative_hash_template_arg (field, val);
...@@ -21062,6 +21063,8 @@ value_dependent_expression_p (tree expression) ...@@ -21062,6 +21063,8 @@ value_dependent_expression_p (tree expression)
{ {
unsigned ix; unsigned ix;
tree val; tree val;
if (dependent_type_p (TREE_TYPE (expression)))
return true;
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expression), ix, val) FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expression), ix, val)
if (value_dependent_expression_p (val)) if (value_dependent_expression_p (val))
return true; return true;
......
// PR c++/63415
// { dg-do compile { target c++11 } }
template <typename T>
struct A {
static constexpr int value = int(T{});
};
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