aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>1998-03-24 16:13:09 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-03-24 16:13:09 +0000
commitae16ec5f2c93d51d755ea453b4c4efa5e3557e97 (patch)
treee242c05f32097dd5257be0cc5fab56ce93f3d6a4
parentd229896557dbe44439b0f64aa1cd01369da14c15 (diff)
downloadgcc-ae16ec5f2c93d51d755ea453b4c4efa5e3557e97.zip
gcc-ae16ec5f2c93d51d755ea453b4c4efa5e3557e97.tar.gz
gcc-ae16ec5f2c93d51d755ea453b4c4efa5e3557e97.tar.bz2
tree.c (mapcar): When dealing with a DECL, use it's constant value, if any.
� * tree.c (mapcar): When dealing with a DECL, use it's constant value, if any. * pt.c (lookup_template_class): Don't mangle the names of template classes whose arguments are unknown. * pt.c (tsubst_expr): Handle GOTO_STMT correctly. From-SVN: r18803
-rw-r--r--gcc/cp/tree.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index dd6d50f..d23a3cd 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1473,8 +1473,18 @@ mapcar (t, func)
/* Rather than aborting, return error_mark_node. This allows us
to report a sensible error message on code like this:
- void g() { int i; f<i>(7); } */
- return error_mark_node;
+ void g() { int i; f<i>(7); }
+
+ In a case like:
+
+ void g() { const int i = 7; f<i>(7); }
+
+ however, we must actually return the constant initializer. */
+ tmp = decl_constant_value (t);
+ if (tmp != t)
+ return mapcar (tmp, func);
+ else
+ return error_mark_node;
case PARM_DECL:
{