mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-25 13:11:13 +08:00
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
This commit is contained in:
parent
7ff9af9bd6
commit
8152661be6
@ -1,5 +1,8 @@
|
|||||||
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,17 +1760,15 @@ 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
|
/* Do not return an aggregate constant (of which
|
||||||
: (!TREE_CONSTANT (init)
|
string literals are a special case), as we do not
|
||||||
/* Do not return an aggregate constant (of which
|
want to make inadvertent copies of such entities,
|
||||||
string literals are a special case), as we do not
|
and we must be sure that their addresses are the
|
||||||
want to make inadvertent copies of such entities,
|
same everywhere. */
|
||||||
and we must be sure that their addresses are the
|
&& (TREE_CODE (init) == CONSTRUCTOR
|
||||||
same everywhere. */
|
|| TREE_CODE (init) == STRING_CST)))
|
||||||
|| TREE_CODE (init) == CONSTRUCTOR
|
|
||||||
|| TREE_CODE (init) == STRING_CST)))
|
|
||||||
break;
|
break;
|
||||||
decl = unshare_expr (init);
|
decl = unshare_expr (init);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
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
|
||||||
|
9
gcc/testsuite/g++.dg/cpp0x/regress/non-const1.C
Normal file
9
gcc/testsuite/g++.dg/cpp0x/regress/non-const1.C
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user