Commit 429b876b by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/23287 (Explicitly invoking destructor of template class in a template and is dependent)

cp/
	PR c++/23287
	* parser.c (cp_parser_id_expression): Add member_p
	argument. Update all callers.
	(cp_parser_unqualified_id): Likewise.  Lookup a destructor name in
	the object's scope, if valid.
	(cp_parser_global_scope_opt): Add object_scope_valid_p.  Update
	callers.
	(cp_parser_postfix_dot_deref_expression): Set object_scope.
	* pt.c (tsubst_copy_and_build): Lookup dependent dtor name here.
testsuite/
	PR c++/23287
	* g++.dg/parse/dtor12.C: New.

From-SVN: r116623
parent 39aa3581
2006-09-01 Nathan Sidwell <nathan@codesourcery.com>
PR c++/23287
* parser.c (cp_parser_id_expression): Add member_p
argument. Update all callers.
(cp_parser_unqualified_id): Likewise. Lookup a destructor name in
the object's scope, if valid.
(cp_parser_global_scope_opt): Add object_scope_valid_p. Update
callers.
(cp_parser_postfix_dot_deref_expression): Set object_scope.
* pt.c (tsubst_copy_and_build): Lookup dependent dtor name here.
2006-08-30 Jason Merrill <jason@redhat.com>
PR c++/26670
......
......@@ -9200,6 +9200,14 @@ tsubst_copy_and_build (tree t,
member = tsubst_baselink (member,
non_reference (TREE_TYPE (object)),
args, complain, in_decl);
else if (TREE_CODE (member) == BIT_NOT_EXPR
&& !TYPE_P (TREE_OPERAND (member, 0)))
{
tree id = TREE_OPERAND (member, 0);
id = make_typename_type (object_type, id, typename_type, complain);
gcc_assert (TREE_CODE (id) != TYPENAME_TYPE);
member = build_nt (BIT_NOT_EXPR, id);
}
else
member = tsubst_copy (member, args, complain, in_decl);
if (member == error_mark_node)
......
2006-09-01 Nathan Sidwell <nathan@codesourcery.com>
PR c++/23287
* g++.dg/parse/dtor12.C: New.
2006-08-31 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/28839
// Copyright (C) 2006 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 1 Sep 2006 <nathan@codesourcery.com>
// PR 23287: Failure to parse dependent dtor name
// Origin:Wolfgang Bangerth <bangerth@dealii.org>
template <class T> struct A {};
template <class T> void f(A<T> *ptr) {
ptr->~A();
}
template void f<void> (A<void> *);
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