This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3 patch] Extend smart ptr assertions to reject void*


On 30 October 2013 19:49, Jonathan Wakely wrote:
> Because of the GNU extension that allows sizeof(void) we fail to
> reject ill-formed programs. This patch fixes that.
>
> 2013-10-30  Jonathan Wakely  <jwakely.gcc@gmail.com>
>
>         * include/bits/shared_ptr (__shared_ptr): Assert non-void pointer.
>         * include/bits/shared_ptr (default_delete): Likewise.
>         * include/backward/auto_ptr.h (__shared_ptr(auto_ptr&&)): Likewise.
>         * testsuite/20_util/shared_ptr/cons/58839.cc: Do not use
>         default_delete<void>.
>         * testsuite/20_util/shared_ptr/cons/void_neg.cc: New.
>         * testsuite/20_util/default_delete/void_neg.cc: New.
>         * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
>         * testsuite/20_util/unique_ptr/assign/48635_neg.cc: Likewise.
>
> Tested x86_64-linux, committed to trunk.

And this just corrects the recently-added testcase on the 4.8 branch.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]