diff options
author | Simon Martin <simartin@users.sourceforge.net> | 2009-07-06 04:55:20 +0000 |
---|---|---|
committer | Simon Martin <simartin@gcc.gnu.org> | 2009-07-06 04:55:20 +0000 |
commit | c4efba1c212b3cc4c3af05a420888b878fcc29ae (patch) | |
tree | 8b91a502c4d1053787176cc0bd0f199bd0077f4e /gcc/cp | |
parent | e2e23550fca10255ad0251e10c53fbeecc8bc057 (diff) | |
download | gcc-c4efba1c212b3cc4c3af05a420888b878fcc29ae.zip gcc-c4efba1c212b3cc4c3af05a420888b878fcc29ae.tar.gz gcc-c4efba1c212b3cc4c3af05a420888b878fcc29ae.tar.bz2 |
re PR c++/40557 (ICE with template union)
gcc/cp/
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.
gcc/testsuite/
2009-07-06 Simon Martin <simartin@users.sourceforge.net>
PR c++/40557
* g++.dg/template/union2.C: New test.
From-SVN: r149276
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/pt.c | 7 |
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); |