summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-28 18:09:25 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-28 18:09:25 +0000
commitd05f521d49e16ad5ac10cf7fe213d36e0d1e0c15 (patch)
tree5785664bcf93e5715d9cb56151994c2c3c6d66f5 /gcc/cp/semantics.c
parentbc8bb82538304e37bc9163580496d69daf1c1d36 (diff)
downloadgcc-d05f521d49e16ad5ac10cf7fe213d36e0d1e0c15.tar.gz
2007-01-28 Andrew Pinski <pinskia@gmail.com>
PR C++/28988 * semantics.c (finish_pseudo_destructor_expr): Check the destrutor name by calling check_dtor_name. 2007-01-28 Andrew Pinski <pinskia@gmail.com> PR C++/28988 * g++.dg/expr/dtor4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121261 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 538f7b4ec15..fea33417aee 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1956,6 +1956,13 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
error ("invalid qualifying scope in pseudo-destructor name");
return error_mark_node;
}
+ if (scope && TYPE_P (scope) && !check_dtor_name (scope, destructor))
+ {
+ error ("qualified type %qT does not match destructor name ~%qT",
+ scope, destructor);
+ return error_mark_node;
+ }
+
/* [expr.pseudo] says both: