Commit 2a2193e0 by Simon Martin Committed by Simon Martin

re PR c++/30895 (ICE with complex values in template parameter)

2007-03-04  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/30895
	* tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.

From-SVN: r122532
parent 270d43bf
2007-03-04 Simon Martin <simartin@users.sourceforge.net>
PR c++/30895
* tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/15787
......
......@@ -1670,6 +1670,10 @@ cp_tree_equal (tree t1, tree t2)
&& !memcmp (TREE_STRING_POINTER (t1), TREE_STRING_POINTER (t2),
TREE_STRING_LENGTH (t1));
case COMPLEX_CST:
return cp_tree_equal (TREE_REALPART (t1), TREE_REALPART (t2))
&& cp_tree_equal (TREE_IMAGPART (t1), TREE_IMAGPART (t2));
case CONSTRUCTOR:
/* We need to do this when determining whether or not two
non-type pointer to member function template arguments
......
2007-03-04 Simon Martin <simartin@users.sourceforge.net>
PR c++/30895
* g++.dg/parse/template23.C: New test.
2007-03-04 Roger Sayle <roger@eyesopen.com>
PR middle-end/30744
/* PR c++/30895 This used to ICE. */
/* { dg-do "compile" } */
template<int> struct A {};
template<typename T> struct B
{
A<T(0i)> a1; /* { dg-error "imaginary constants are a GCC extension" } */
A<T(0i)> a2; /* { dg-error "imaginary constants are a GCC extension" } */
};
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