gcc/libstdc++-v3
Martin Sebor dce6c58db8 Add support for detecting mismatched allocation/deallocation calls.
PR c++/90629 - Support for -Wmismatched-new-delete
PR middle-end/94527 - Add an __attribute__ that marks a function as freeing an object

gcc/ChangeLog:

	PR c++/90629
	PR middle-end/94527
	* builtins.c (access_ref::access_ref): Initialize new member.
	(compute_objsize): Use access_ref::deref.  Handle simple pointer
	assignment.
	(expand_builtin): Remove handling of the free built-in.
	(call_dealloc_argno): Same.
	(find_assignment_location): New function.
	(fndecl_alloc_p): Same.
	(gimple_call_alloc_p): Same.
	(call_dealloc_p): Same.
	(matching_alloc_calls_p): Same.
	(warn_dealloc_offset): Same.
	(maybe_emit_free_warning): Same.
	* builtins.h (struct access_ref): Declare new member.
	(maybe_emit_free_warning): Make extern.  Make use of access_ref.
	Handle -Wmismatched-new-delete.
	* calls.c (initialize_argument_information): Call
	maybe_emit_free_warning.
	* doc/extend.texi (attribute malloc): Update.
	* doc/invoke.texi (-Wfree-nonheap-object): Expand documentation.
	(-Wmismatched-new-delete): Document new option.
	(-Wmismatched-dealloc): Document new option.

gcc/c-family/ChangeLog:

	PR c++/90629
	PR middle-end/94527
	* c-attribs.c (handle_dealloc_attribute): New function.
	(handle_malloc_attribute): Handle argument forms of attribute.
	* c.opt (-Wmismatched-dealloc): New option.
	(-Wmismatched-new-delete): New option.

gcc/testsuite/ChangeLog:

	PR c++/90629
	PR middle-end/94527
	* g++.dg/asan/asan_test.cc: Fix a bug.
	* g++.dg/warn/delete-array-1.C: Add expected warning.
	* g++.old-deja/g++.other/delete2.C: Add expected warning.
	* g++.dg/warn/Wfree-nonheap-object-2.C: New test.
	* g++.dg/warn/Wfree-nonheap-object.C: New test.
	* g++.dg/warn/Wmismatched-new-delete.C: New test.
	* g++.dg/warn/Wmismatched-dealloc-2.C: New test.
	* g++.dg/warn/Wmismatched-dealloc.C: New test.
	* gcc.dg/Wmismatched-dealloc.c: New test.
	* gcc.dg/analyzer/malloc-1.c: Prune out expected warning.
	* gcc.dg/attr-malloc.c: New test.
	* gcc.dg/free-1.c: Adjust text of expected warning.
	* gcc.dg/free-2.c: Same.
	* gcc.dg/torture/pr71816.c: Prune out expected warning.
	* gcc.dg/tree-ssa/pr19831-2.c: Add an expected warning.
	* gcc.dg/Wfree-nonheap-object-2.c: New test.
	* gcc.dg/Wfree-nonheap-object-3.c: New test.
	* gcc.dg/Wfree-nonheap-object.c: New test.

libstdc++-v3/ChangeLog:

	* testsuite/ext/vstring/modifiers/clear/56166.cc: Suppress a false
	positive warning.
2020-12-03 15:43:32 -07:00
..
config libstdc++: Update powerpc-linux baselines for GCC 10.1 2020-12-03 17:18:28 +00:00
doc libstdc++: Update C++20 library implementation status 2020-12-03 19:17:13 +00:00
include libtdc++: Define std::source_location for C++20 2020-12-03 19:17:13 +00:00
libsupc++ libstdc++: Use 'inline' consistently in std::exception_ptr [PR 97729] 2020-11-09 14:28:38 +00:00
po
python libstdc++: Fix std::any pretty printer [PR 68735] 2020-12-02 21:39:08 +00:00
scripts libstdc++: Pass CXXFLAGS to check_performance script 2020-10-09 14:01:55 +01:00
src libstdc++: Partially revert r11-5314 2020-11-27 12:25:02 +00:00
testsuite Add support for detecting mismatched allocation/deallocation calls. 2020-12-03 15:43:32 -07:00
ChangeLog Daily bump. 2020-12-03 00:16:47 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
Makefile.am
Makefile.in
README
acinclude.m4 ada: c++: Get rid of libposix4, librt on Solaris 2020-11-26 13:01:30 +01:00
aclocal.m4
config.h.in libstdc++: Add configure checks for semaphores 2020-11-23 18:12:39 +00:00
configure Fix hppa64-hpux11 build to remove source paths from embedded path. 2020-11-29 20:11:38 +00:00
configure.ac
configure.host Scope libstdc++ configuration for vxworks to all versions 2020-10-22 16:40:57 +00:00
crossconfig.m4 Scope libstdc++ configuration for vxworks to all versions 2020-10-22 16:40:57 +00:00
fragment.am
linkage.m4

README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.