mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-22 11:41:07 +08:00
Be clear about virtual table pointer corruptuion rather than the vtable itself.
From-SVN: r256852
This commit is contained in:
parent
00850e40be
commit
8ca07d928c
@ -1,3 +1,7 @@
|
||||
2018-01-18 Martin Sebor <msebor@redhat.com>
|
||||
|
||||
* doc/invoke.texi (-Wclass-memaccess): Tweak text.
|
||||
|
||||
2018-01-18 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR ipa/83619
|
||||
|
@ -2970,11 +2970,11 @@ Warn when the destination of a call to a raw memory function such as
|
||||
@code{memset} or @code{memcpy} is an object of class type, and when writing
|
||||
into such an object might bypass the class non-trivial or deleted constructor
|
||||
or copy assignment, violate const-correctness or encapsulation, or corrupt
|
||||
the virtual table. Modifying the representation of such objects may violate
|
||||
invariants maintained by member functions of the class. For example, the call
|
||||
to @code{memset} below is undefined because it modifies a non-trivial class
|
||||
object and is, therefore, diagnosed. The safe way to either initialize or
|
||||
clear the storage of objects of such types is by using the appropriate
|
||||
virtual table pointers. Modifying the representation of such objects may
|
||||
violate invariants maintained by member functions of the class. For example,
|
||||
the call to @code{memset} below is undefined because it modifies a non-trivial
|
||||
class object and is, therefore, diagnosed. The safe way to either initialize
|
||||
or clear the storage of objects of such types is by using the appropriate
|
||||
constructor or assignment operator, if one is available.
|
||||
@smallexample
|
||||
std::string str = "abc";
|
||||
|
Loading…
x
Reference in New Issue
Block a user