[Bug c++/77321] [7 Regression] crash in warn_for_memset
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Aug 22 21:48:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77321
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Target Milestone|--- |7.0
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
All right, I'm going to commit the patch with this testcase instead (it's the
original testcase, I just removed #includes and added prototypes.
extern "C" void *memset (void *, int, __SIZE_TYPE__);
extern "C" void *malloc(__SIZE_TYPE__);
struct S {
char *a;
};
template <typename T>
void Test(T & Obj) {
auto && a(Obj.a);
a = (char*)::malloc(1024 * 1024);
::memset(a + 28, 'X', 6);
}
int main()
{
S d;
Test(d);
return 0;
}
More information about the Gcc-bugs
mailing list