diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-28 18:09:25 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-28 18:09:25 +0000 |
commit | d05f521d49e16ad5ac10cf7fe213d36e0d1e0c15 (patch) | |
tree | 5785664bcf93e5715d9cb56151994c2c3c6d66f5 /gcc | |
parent | bc8bb82538304e37bc9163580496d69daf1c1d36 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/expr/dtor4.C | 10 |
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e04ee5a4cc5..2d8264ea3ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +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-24 Douglas Gregor <dgregor@osl.iu.edu> * lex.c (D_CPP0X): Rename. 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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 62634656b17..6282034b21e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-01-28 Andrew Pinski <pinskia@gmail.com> + + PR C++/28988 + * g++.dg/expr/dtor4.C: New test. + 2007-01-28 Zdenek Dvorak <dvorakz@suse.cz> * gcc.dg/tree-ssa/loop-23.c: New test. diff --git a/gcc/testsuite/g++.dg/expr/dtor4.C b/gcc/testsuite/g++.dg/expr/dtor4.C new file mode 100644 index 00000000000..7aed80a69bd --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/dtor4.C @@ -0,0 +1,10 @@ +typedef int C; +typedef double D; + +void +f () +{ + C o; + + o.D::~C (); // { dg-error "" } +} |