diff options
author | Dodji Seketeli <dodji@redhat.com> | 2011-11-09 07:51:12 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2011-11-09 08:51:12 +0100 |
commit | acfdadb47be3a0c84fd3a3bb4397ac8d37fab8b2 (patch) | |
tree | 493b7b7c7817efe6b540f19cb9ce7d1f9fee0568 /gcc/cp | |
parent | f354bf1d8c08e76d572def991c7b658ac9bc15fb (diff) | |
download | gcc-acfdadb47be3a0c84fd3a3bb4397ac8d37fab8b2.tar.gz |
PR debug/51032 - ICE in dbxout_type, at dbxout.c:2372
gcc/cp/
* decl2.c (check_member_template): Accept alias templates and ...
* parser.c (cp_parser_alias_declaration): ... use it here.
gcc/testsuite/
* g++.dg/cpp0x/alias-decl-debug-0.C: New test.
From-SVN: r181193
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 1 | ||||
-rw-r--r-- | gcc/cp/parser.c | 11 |
3 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 58241a8088f..6445befedd3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-11-09 Dodji Seketeli <dodji@redhat.com> + + PR debug/51032 + * decl2.c (check_member_template): Accept alias templates and ... + * parser.c (cp_parser_alias_declaration): ... use it here. + 2011-11-08 Jason Merrill <jason@redhat.com> PR c++/50835 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 3dc5a69df54..4e24755e2a5 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -495,6 +495,7 @@ check_member_template (tree tmpl) decl = DECL_TEMPLATE_RESULT (tmpl); if (TREE_CODE (decl) == FUNCTION_DECL + || DECL_ALIAS_TEMPLATE_P (tmpl) || (TREE_CODE (decl) == TYPE_DECL && MAYBE_CLASS_TYPE_P (TREE_TYPE (decl)))) { diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 12f3c4011fa..fde4c6d838f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -14932,6 +14932,7 @@ cp_parser_alias_declaration (cp_parser* parser) location_t id_location; cp_declarator *declarator; cp_decl_specifier_seq decl_specs; + bool member_p; /* Look for the `using' keyword. */ cp_parser_require_keyword (parser, RID_USING, RT_USING); @@ -14957,7 +14958,8 @@ cp_parser_alias_declaration (cp_parser* parser) declarator = make_id_declarator (NULL_TREE, id, sfk_none); declarator->id_loc = id_location; - if (at_class_scope_p ()) + member_p = at_class_scope_p (); + if (member_p) decl = grokfield (declarator, &decl_specs, NULL_TREE, false, NULL_TREE, attributes); else @@ -14976,7 +14978,12 @@ cp_parser_alias_declaration (cp_parser* parser) if (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl) && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))) - decl = DECL_TI_TEMPLATE (decl); + { + decl = DECL_TI_TEMPLATE (decl); + if (member_p) + check_member_template (decl); + } + return decl; } |