Commit 62daa139 by Jason Merrill Committed by Jason Merrill

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
parent d5eebac0
2010-04-06 Jason Merrill <jason@redhat.com> 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 PR c++/43621
* pt.c (maybe_update_decl_type): Check the return value from * pt.c (maybe_update_decl_type): Check the return value from
push_scope. push_scope.
......
...@@ -3897,13 +3897,15 @@ cp_parser_unqualified_id (cp_parser* parser, ...@@ -3897,13 +3897,15 @@ cp_parser_unqualified_id (cp_parser* parser,
} }
gcc_assert (!scope || TYPE_P (scope)); 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); token = cp_lexer_peek_token (parser->lexer);
if (scope if (scope
&& token->type == CPP_NAME && token->type == CPP_NAME
&& (cp_lexer_peek_nth_token (parser->lexer, 2)->type && (cp_lexer_peek_nth_token (parser->lexer, 2)->type
!= CPP_LESS) != 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); cp_lexer_consume_token (parser->lexer);
return build_nt (BIT_NOT_EXPR, scope); return build_nt (BIT_NOT_EXPR, scope);
......
2010-04-06 Jason Merrill <jason@redhat.com> 2010-04-06 Jason Merrill <jason@redhat.com>
PR c++/43648
* g++.dg/template/dtor8.C: New.
PR c++/43621 PR c++/43621
* g++.dg/template/error-recovery2.C: New. * g++.dg/template/error-recovery2.C: New.
......
// PR c++/43648
namespace dealii
{
namespace FEValuesViews
{
template <int dim, int spacedim> struct Scalar {};
}
template <int dim, int spacedim>
struct X
{
FEValuesViews::Scalar<dim,spacedim> scalars[dim*spacedim];
void f()
{
typedef dealii::FEValuesViews::Scalar<dim,spacedim> ScalarView;
scalars[0].ScalarView::~ScalarView ();
}
};
template struct X<2,2>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment