aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2007-09-20 10:13:00 -0400
committerJason Merrill <jason@gcc.gnu.org>2007-09-20 10:13:00 -0400
commit56d0c6e3f540686a9d7e240c536b7c2fe361bbe2 (patch)
tree497200eb12dfd940a8293d497ecc5a24595fb6ef /gcc/cp/class.c
parent152315665ec17e11bad055588958922ae831def8 (diff)
downloadgcc-56d0c6e3f540686a9d7e240c536b7c2fe361bbe2.zip
gcc-56d0c6e3f540686a9d7e240c536b7c2fe361bbe2.tar.gz
gcc-56d0c6e3f540686a9d7e240c536b7c2fe361bbe2.tar.bz2
re PR c++/7586 (Incorrect handling of attributes in template codes)
PR c++/7586 * pt.c (tsubst): Handle typedefs by looking for the specialization. (retrieve_specialization): Only tagged types use DECL_TEMPLATE_INSTANTIATIONS. (instantiate_class_template): Push nested classes too. (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for tagged types. * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro. * init.c (is_aggr_type): Remove redundant tests. * class.c (push_nested_class): Use CLASS_TYPE_P. From-SVN: r128621
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 9e0502f..5c3e054 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -5645,21 +5645,13 @@ currently_open_derived_class (tree t)
void
push_nested_class (tree type)
{
- tree context;
-
/* A namespace might be passed in error cases, like A::B:C. */
if (type == NULL_TREE
- || type == error_mark_node
- || TREE_CODE (type) == NAMESPACE_DECL
- || ! IS_AGGR_TYPE (type)
- || TREE_CODE (type) == TEMPLATE_TYPE_PARM
- || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ || !CLASS_TYPE_P (type))
return;
- context = DECL_CONTEXT (TYPE_MAIN_DECL (type));
+ push_nested_class (DECL_CONTEXT (TYPE_MAIN_DECL (type)));
- if (context && CLASS_TYPE_P (context))
- push_nested_class (context);
pushclass (type);
}