PR c++/83555
commit13da18cc2861989928a29c0dfe500aa42891678e
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Jan 2018 20:37:41 +0000 (3 20:37 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Jan 2018 20:37:41 +0000 (3 20:37 +0000)
tree4caa4cc0a2b0794c69cc3be5c592273f1dbcc26b
parent1966389cb8efd0d7934ce50f2dcfcdb23193d0bf
PR c++/83555
* typeck.c (build_static_cast_1): For static casts to reference types,
call build_base_path with flag_delete_null_pointer_checks as nonnull
instead of always false.  When -fsanitize=null, call
ubsan_maybe_instrument_reference on the NULL reference INTEGER_CST.
* cp-gimplify.c (cp_genericize_r): Don't walk subtrees of UBSAN_NULL
call if the first argument is INTEGER_CST with REFERENCE_TYPE.

* g++.dg/opt/pr83555.C: New test.
* g++.dg/ubsan/pr83555.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256186 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr83555.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/pr83555.C [new file with mode: 0644]