aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index abde58c..22f3dde 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2011-09-26 Jason Merrill <jason@redhat.com>
+ PR c++/45102
+ * pt.c (tsubst_copy_and_build) [CONST_DECL]: Don't pull out
+ constant value if we're still in a template.
+
PR c++/46105
* typeck.c (structural_comptypes): Ignore cv-quals on typename scope.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index cac45f9..4d57f94 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13916,7 +13916,7 @@ tsubst_copy_and_build (tree t,
t = tsubst_copy (t, args, complain, in_decl);
/* As in finish_id_expression, we resolve enumeration constants
to their underlying values. */
- if (TREE_CODE (t) == CONST_DECL)
+ if (TREE_CODE (t) == CONST_DECL && !processing_template_decl)
{
used_types_insert (TREE_TYPE (t));
return DECL_INITIAL (t);