aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-03-08 00:28:02 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-03-08 00:28:02 -0500
commit8152661be6564d7369d88e32dded29641183b248 (patch)
treec05554a298821a6a5993daaccb505a0eeb18bf3f /gcc/cp
parent7ff9af9bd6698d3e63dba6d6200280c177bd5d5a (diff)
downloadgcc-8152661be6564d7369d88e32dded29641183b248.zip
gcc-8152661be6564d7369d88e32dded29641183b248.tar.gz
gcc-8152661be6564d7369d88e32dded29641183b248.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/init.c20
2 files changed, 12 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 03fe7de..a82947f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
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
* mangle.c (write_type): Strip cv-quals from FUNCTION_TYPE here.
(write_CV_qualifiers_for_type): Not here.
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index e590118..56f66fa 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1760,17 +1760,15 @@ constant_value_1 (tree decl, bool integral_p)
init = TREE_VALUE (init);
if (!init
|| !TREE_TYPE (init)
- || uses_template_parms (init)
- || (integral_p
- ? false
- : (!TREE_CONSTANT (init)
- /* Do not return an aggregate constant (of which
- string literals are a special case), as we do not
- want to make inadvertent copies of such entities,
- and we must be sure that their addresses are the
- same everywhere. */
- || TREE_CODE (init) == CONSTRUCTOR
- || TREE_CODE (init) == STRING_CST)))
+ || !TREE_CONSTANT (init)
+ || (!integral_p
+ /* Do not return an aggregate constant (of which
+ string literals are a special case), as we do not
+ want to make inadvertent copies of such entities,
+ and we must be sure that their addresses are the
+ same everywhere. */
+ && (TREE_CODE (init) == CONSTRUCTOR
+ || TREE_CODE (init) == STRING_CST)))
break;
decl = unshare_expr (init);
}