+2016-08-22 Marek Polacek <polacek@redhat.com>
+
+ PR c++/77321
+ * c-common.c (warn_for_memset): Check type for null.
+
2016-08-22 Joseph Myers <joseph@codesourcery.com>
* c-family/c-cppbuiltin.c (c_cpp_builtins): Check _FloatN and
if (TREE_CODE (arg0) == ADDR_EXPR)
arg0 = TREE_OPERAND (arg0, 0);
tree type = TREE_TYPE (arg0);
- if (TREE_CODE (type) == ARRAY_TYPE)
+ if (type != NULL_TREE && TREE_CODE (type) == ARRAY_TYPE)
{
tree elt_type = TREE_TYPE (type);
tree domain = TYPE_DOMAIN (type);
+2016-08-22 Marek Polacek <polacek@redhat.com>
+
+ PR c++/77321
+ * g++.dg/cpp1y/pr77321.C: New test.
+
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/60774
--- /dev/null
+// PR c++/77321
+// { dg-do compile { target c++14 } }
+// { dg-options "-Wall" }
+
+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;
+}