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.
}
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);
2010-04-06 Jason Merrill <jason@redhat.com>
+ PR c++/43648
+ * g++.dg/template/dtor8.C: New.
+
PR c++/43621
* g++.dg/template/error-recovery2.C: New.
--- /dev/null
+// 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>;
+}