re PR sanitizer/87095 (UndefinedBehaviorSanitizer vptr false positive with virtual...
authorJakub Jelinek <jakub@redhat.com>
Wed, 29 Aug 2018 21:43:18 +0000 (23:43 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 29 Aug 2018 21:43:18 +0000 (23:43 +0200)
commitd66ab7d12bb632c3de947f535d189275209a3915
treee9969bd7b11fc9b19be570b837a4ec3185ec6f29
parent849ec6caae2fa53d3f552a1d58fd151a93a39edc
re PR sanitizer/87095 (UndefinedBehaviorSanitizer vptr false positive with virtual inheritance only with -fno-sanitize-recover)

PR c++/87095
* decl.c (begin_destructor_body): If current_class_type has
virtual bases and the primary base is nearly empty virtual base,
voidify clearing of vptr and make it conditional on in-charge
argument.

* g++.dg/ubsan/vptr-13.C: New test.

From-SVN: r263967
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ubsan/vptr-13.C [new file with mode: 0644]