aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-03-19 07:27:30 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-03-19 07:27:30 +0000
commit26bcf8fc16a06d4fe16ac25ce79739e2e6cb7445 (patch)
tree78c8fee7aeff0e01a8b8cc9aef49a891bccb39a7 /gcc/cp/semantics.c
parentff3fcb8a50f89eff597c9d5e8f8d1cf6e31b809b (diff)
downloadgcc-26bcf8fc16a06d4fe16ac25ce79739e2e6cb7445.zip
gcc-26bcf8fc16a06d4fe16ac25ce79739e2e6cb7445.tar.gz
gcc-26bcf8fc16a06d4fe16ac25ce79739e2e6cb7445.tar.bz2
semantics.c (finish_pseudo_destructor_expr): Allow differing cv-qualification between the type named by the...
* semantics.c (finish_pseudo_destructor_expr): Allow differing cv-qualification between the type named by the pseudo-destructor-name and the object-type. * search.c (accessible_base_p): Handle non-proper bases. * name-lookup.c (do_nonmember_using_decl): If a using declaration refers to a single overloaded function, set the type of the function. * tree.c (lvalue_type): Simplify. * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an unknown type. (build_unary_op): Handle OVERLOADs with known types. * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for function templates. * parser.c (cp_parser_postfix_expression): Handle the use of "typename" in non-dependent contexts. Convert appropriately when when using a qualified name after "->" or ".". * call.c (conditional_conversion): Honor the requirement that some conversions refer to the original object. * g++.dg/expr/dtor2.C: New test. * g++.dg/lookup/anon4.C: New test. * g++.dg/overload/using1.C: New test. * g++.dg/template/lookup7.C: New test. * g++.dg/template/typename6.C: New test. * g++.dg/expr/cond6.C: New test. From-SVN: r79671
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index e7d3771..50cb153 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1803,7 +1803,21 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
return error_mark_node;
}
- if (!same_type_p (TREE_TYPE (object), destructor))
+ /* [expr.pseudo] says both:
+
+ The type designated by the pseudo-destructor-name shall be
+ the same as the object type.
+
+ and:
+
+ The cv-unqualified versions of the object type and of the
+ type designated by the pseudo-destructor-name shall be the
+ same type.
+
+ We implement the more generous second sentence, since that is
+ what most other compilers do. */
+ if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (object),
+ destructor))
{
error ("`%E' is not of type `%T'", object, destructor);
return error_mark_node;