cp:
PR c++/21165
* init.c (integral_constant_value): Check the type of the
initializer, not the decl.
testsuite:
PR c++/21165
* g++.dg/template/init5.C: New.
From-SVN: r100402
+2005-05-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21165
+ * init.c (integral_constant_value): Check the type of the
+ initializer, not the decl.
+
2005-05-30 Mark Mitchell <mark@codesourcery.com>
PR c++/21784
&& DECL_INITIAL (decl)
&& DECL_INITIAL (decl) != error_mark_node
&& TREE_TYPE (DECL_INITIAL (decl))
- && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
+ && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (DECL_INITIAL (decl))))
decl = DECL_INITIAL (decl);
return decl;
}
+2005-05-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21165
+ * g++.dg/template/init5.C: New.
+
2005-05-31 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/char_initialiser_actual.f90:
--- /dev/null
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 May 2005 <nathan@codesourcery.com>
+
+// PR 21165. ICE on valid
+// Origin:Volker Reichelt reichelt@gcc.gnu.org
+
+template<typename T> bool foo()
+{
+ const int i = T();
+ return i > 0;
+}