diff options
author | Jason Merrill <jason@redhat.com> | 2010-04-06 12:12:15 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-04-06 12:12:15 -0400 |
commit | 62daa13984dac4fbe37f94755978ad886925939d (patch) | |
tree | 32fa8edb54507dcc439e45fd466f7cd32e1d1fb9 /gcc/cp | |
parent | d5eebac0bb24b578e98d99d290c68ed0e101b0b0 (diff) | |
download | gcc-62daa13984dac4fbe37f94755978ad886925939d.zip gcc-62daa13984dac4fbe37f94755978ad886925939d.tar.gz gcc-62daa13984dac4fbe37f94755978ad886925939d.tar.bz2 |
re PR c++/43648 (ICE with explicit destructor call and typedef)
PR c++/43648
* name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
From-SVN: r158007
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/parser.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9a2f01d..59b0e40 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2010-04-06 Jason Merrill <jason@redhat.com> + PR c++/43648 + * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs. + PR c++/43621 * pt.c (maybe_update_decl_type): Check the return value from push_scope. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 6b119b6..8a1bb9f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3897,13 +3897,15 @@ cp_parser_unqualified_id (cp_parser* parser, } gcc_assert (!scope || TYPE_P (scope)); - /* If the name is of the form "X::~X" it's OK. */ + /* If the name is of the form "X::~X" it's OK even if X is a + typedef. */ token = cp_lexer_peek_token (parser->lexer); if (scope && token->type == CPP_NAME && (cp_lexer_peek_nth_token (parser->lexer, 2)->type != CPP_LESS) - && constructor_name_p (token->u.value, scope)) + && (token->u.value == TYPE_IDENTIFIER (scope) + || constructor_name_p (token->u.value, scope))) { cp_lexer_consume_token (parser->lexer); return build_nt (BIT_NOT_EXPR, scope); |