Commit 8bd46447 by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/21165 (bogus error on a user-defined conversion in a template)

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
parent fba53b18
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
......
......@@ -1573,7 +1573,7 @@ integral_constant_value (tree decl)
&& 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:
......
// 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;
}
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