Commit 8152661b by Jason Merrill Committed by Jason Merrill

re PR c++/48015 ([C++0x] ICE: unexpected expression 'std::min' of kind overload)

	PR c++/48015
	* init.c (constant_value_1): Always require init to be TREE_CONSTANT.

From-SVN: r170770
parent 7ff9af9b
2011-03-07 Jason Merrill <jason@redhat.com> 2011-03-07 Jason Merrill <jason@redhat.com>
PR c++/48015
* init.c (constant_value_1): Always require init to be TREE_CONSTANT.
PR c++/48008 PR c++/48008
* mangle.c (write_type): Strip cv-quals from FUNCTION_TYPE here. * mangle.c (write_type): Strip cv-quals from FUNCTION_TYPE here.
(write_CV_qualifiers_for_type): Not here. (write_CV_qualifiers_for_type): Not here.
......
...@@ -1760,16 +1760,14 @@ constant_value_1 (tree decl, bool integral_p) ...@@ -1760,16 +1760,14 @@ constant_value_1 (tree decl, bool integral_p)
init = TREE_VALUE (init); init = TREE_VALUE (init);
if (!init if (!init
|| !TREE_TYPE (init) || !TREE_TYPE (init)
|| uses_template_parms (init) || !TREE_CONSTANT (init)
|| (integral_p || (!integral_p
? false
: (!TREE_CONSTANT (init)
/* Do not return an aggregate constant (of which /* Do not return an aggregate constant (of which
string literals are a special case), as we do not string literals are a special case), as we do not
want to make inadvertent copies of such entities, want to make inadvertent copies of such entities,
and we must be sure that their addresses are the and we must be sure that their addresses are the
same everywhere. */ same everywhere. */
|| TREE_CODE (init) == CONSTRUCTOR && (TREE_CODE (init) == CONSTRUCTOR
|| TREE_CODE (init) == STRING_CST))) || TREE_CODE (init) == STRING_CST)))
break; break;
decl = unshare_expr (init); decl = unshare_expr (init);
......
2011-03-07 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/regress/non-const1.C: New.
2011-03-07 Jakub Jelinek <jakub@redhat.com> 2011-03-07 Jakub Jelinek <jakub@redhat.com>
PR debug/47991 PR debug/47991
......
// PR c++/48015
// { dg-options -std=c++0x }
template <typename T> T f(T);
template <typename T> void g()
{
int const c = f (1);
int i = c - 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