Fix g++.dg/torture/Wsizeof-pointer-memaccess2.C with -std=c++11
authorJason Merrill <jason@redhat.com>
Wed, 6 May 2015 02:24:44 +0000 (22:24 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 6 May 2015 02:24:44 +0000 (22:24 -0400)
Fix g++.dg/torture/Wsizeof-pointer-memaccess2.C with -std=c++11
* semantics.c (finish_call_expr): Check complain.

From-SVN: r222840

gcc/cp/ChangeLog
gcc/cp/semantics.c

index 029c64937a274c10436bcb1787532a9237a473b5..09476c43a01ca32e79fefb78f5a283e5725f13e2 100644 (file)
@@ -1,5 +1,7 @@
 2015-05-05  Jason Merrill  <jason@redhat.com>
 
+       * semantics.c (finish_call_expr): Check complain.
+
        * decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
        maybe-in-charge constructor.
 
index 0fc08b5f1ed678336f7e9d2e1727d3be4e3cff69..701a8ebf18f14cd95002e8f4dbae9b26e123218a 100644 (file)
@@ -2377,6 +2377,7 @@ finish_call_expr (tree fn, vec<tree, va_gc> **args, bool disallow_virtual,
       if (!result)
        {
          if (warn_sizeof_pointer_memaccess
+             && (complain & tf_warning)
              && !vec_safe_is_empty (*args)
              && !processing_template_decl)
            {