summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-12 04:04:03 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-12 04:04:03 +0000
commit36b92eb7529f4e5122db5fdf60828fdc019c2256 (patch)
tree64e5cc4d84872a31748d1d4ba6500f40fa9fbad3 /gcc/cp/pt.c
parenta1609b5f0760781ad847130112bb0f11b3ae149b (diff)
downloadgcc-36b92eb7529f4e5122db5fdf60828fdc019c2256.tar.gz
* decl2.c (build_anon_union_vars): Copy attributes from the base addr.
* pt.c (tsubst_decl): Substitute in DECL_VALUE_EXPR. * g++.dg/other/error8.C: Update expected diagnostic text. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104160 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f78da9338cc..85e8cb83b86 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6674,6 +6674,13 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (r)
= DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (t);
type = check_var_type (DECL_NAME (r), type);
+
+ if (DECL_HAS_VALUE_EXPR_P (t))
+ {
+ tree ve = DECL_VALUE_EXPR (t);
+ ve = tsubst_expr (ve, args, complain, in_decl);
+ SET_DECL_VALUE_EXPR (r, ve);
+ }
}
else if (DECL_SELF_REFERENCE_P (t))
SET_DECL_SELF_REFERENCE_P (r);