aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/pt.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e3fe9c2..03a0349 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-06 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/40557
+ * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
+ append_type_to_template_for_access_check_1): Use
+ RECORD_OR_UNION_CODE_P.
+
2009-07-04 Jason Merrill <jason@redhat.com>
* pt.c (retrieve_specialization): Don't get confused by a
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4143bb1..f1104e2 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7142,7 +7142,7 @@ perform_typedefs_access_check (tree tmpl, tree targs)
tree t;
if (!tmpl
- || (TREE_CODE (tmpl) != RECORD_TYPE
+ || (!RECORD_OR_UNION_CODE_P (TREE_CODE (tmpl))
&& TREE_CODE (tmpl) != FUNCTION_DECL))
return;
@@ -17512,7 +17512,8 @@ get_types_needing_access_check (tree t)
if (!(ti = get_template_info (t)))
return NULL_TREE;
- if (TREE_CODE (t) == RECORD_TYPE || TREE_CODE (t) == FUNCTION_DECL)
+ if (RECORD_OR_UNION_CODE_P (TREE_CODE (t))
+ || TREE_CODE (t) == FUNCTION_DECL)
{
if (!TI_TEMPLATE (ti))
return NULL_TREE;
@@ -17544,7 +17545,7 @@ append_type_to_template_for_access_check_1 (tree t,
return;
gcc_assert ((TREE_CODE (t) == FUNCTION_DECL
- || TREE_CODE (t) == RECORD_TYPE)
+ || RECORD_OR_UNION_CODE_P (TREE_CODE (t)))
&& type_decl
&& TREE_CODE (type_decl) == TYPE_DECL
&& scope);