Commit ba29e5c2 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/55337 (ICE tree check: expected sizeof_expr, have alignof_expr in…

re PR c++/55337 (ICE tree check: expected sizeof_expr, have alignof_expr in cp_tree_equal, at cp/tree.c:2608)

	PR c++/55337
	* tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Use SIZEOF_EXPR_TYPE_P
	only on SIZEOF_EXPR.

	* g++.dg/template/alignof2.C: New test.

From-SVN: r193558
parent d1caed14
2012-11-16 Jakub Jelinek <jakub@redhat.com>
PR c++/55337
* tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Use SIZEOF_EXPR_TYPE_P
only on SIZEOF_EXPR.
2012-11-14 Jason Merrill <jason@redhat.com> 2012-11-14 Jason Merrill <jason@redhat.com>
PR c++/54903 PR c++/54903
......
...@@ -2610,10 +2610,13 @@ cp_tree_equal (tree t1, tree t2) ...@@ -2610,10 +2610,13 @@ cp_tree_equal (tree t1, tree t2)
tree o1 = TREE_OPERAND (t1, 0); tree o1 = TREE_OPERAND (t1, 0);
tree o2 = TREE_OPERAND (t2, 0); tree o2 = TREE_OPERAND (t2, 0);
if (SIZEOF_EXPR_TYPE_P (t1)) if (code1 == SIZEOF_EXPR)
o1 = TREE_TYPE (o1); {
if (SIZEOF_EXPR_TYPE_P (t2)) if (SIZEOF_EXPR_TYPE_P (t1))
o2 = TREE_TYPE (o2); o1 = TREE_TYPE (o1);
if (SIZEOF_EXPR_TYPE_P (t2))
o2 = TREE_TYPE (o2);
}
if (TREE_CODE (o1) != TREE_CODE (o2)) if (TREE_CODE (o1) != TREE_CODE (o2))
return false; return false;
if (TYPE_P (o1)) if (TYPE_P (o1))
......
2012-11-16 Jakub Jelinek <jakub@redhat.com>
PR c++/55337
* g++.dg/template/alignof2.C: New test.
2012-11-16 Uros Bizjak <ubizjak@gmail.com> 2012-11-16 Uros Bizjak <ubizjak@gmail.com>
* g++.dg/mv1.C (dg-options): Add -march=x86-64. * g++.dg/mv1.C (dg-options): Add -march=x86-64.
......
// PR c++/55337
// { dg-do compile }
template <int> struct A;
template <typename T> struct B
{
static A <__alignof__ (T)> b;
};
template <typename T> A<__alignof__ (T)> B<T>::b;
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