aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 0c0961d..a8c0f92 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -992,7 +992,10 @@ bool
is_late_template_attribute (tree attr)
{
tree name = TREE_PURPOSE (attr);
- if (is_attribute_p ("aligned", name))
+ tree args = TREE_VALUE (attr);
+ if (is_attribute_p ("aligned", name)
+ && args
+ && value_dependent_expression_p (TREE_VALUE (args)))
return true;
else
return false;
@@ -1039,6 +1042,19 @@ save_template_attributes (tree *attr_p, tree *decl_p)
if (!late_attrs)
return;
+ /* Give this type a name so we know to look it up again at instantiation
+ time. */
+ if (TREE_CODE (*decl_p) == TYPE_DECL
+ && DECL_ORIGINAL_TYPE (*decl_p) == NULL_TREE)
+ {
+ tree oldt = TREE_TYPE (*decl_p);
+ tree newt = build_variant_type_copy (oldt);
+ DECL_ORIGINAL_TYPE (*decl_p) = oldt;
+ TREE_TYPE (*decl_p) = newt;
+ TYPE_NAME (newt) = *decl_p;
+ TREE_USED (newt) = TREE_USED (*decl_p);
+ }
+
if (DECL_P (*decl_p))
q = &DECL_ATTRIBUTES (*decl_p);
else