From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29679 invoked by alias); 16 Jun 2017 07:38:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29649 invoked by uid 89); 16 Jun 2017 07:38:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-ot0-f173.google.com Received: from mail-ot0-f173.google.com (HELO mail-ot0-f173.google.com) (74.125.82.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jun 2017 07:38:34 +0000 Received: by mail-ot0-f173.google.com with SMTP id y47so2690489oty.0 for ; Fri, 16 Jun 2017 00:38:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=J9RCX8QoJPCbmlV82+O1zRzpcOOH/2P0PgEl1/EbUfg=; b=hqzz4oa+dVAX80eOgY0gte+RS6zRA5Jho9/R3cU8P/UTgFl3+ZEtNx0pYq1wY7L4v1 6dpGsnzbEmq90FPfCFVhf0vNIlZrmQZUu5sXQZiRlKgF9K/UNentqK3YwfHRPZriQx/g IUr3NkCJXfnMHO1J3S9+WAxhgjRK0Vc1LqHxmw1HRqg8AioCnS/ja2FXTo2l652Uvy7S 6PuOD+IAqD6o21I0e9wBAfJt2QKJjLz+EsoOcvC3afIE0b+Pb18IVW/YtEw7zBoecNNa mMzpBzbnJPym7JHJifGvW6WyKl1a/+qNY8R8RyUweAKKpLFz5xgXBfDU9f0RZz7SvWm2 6aDw== X-Gm-Message-State: AKS2vOzhs6QnNDV6YBM2lgWRoICCEu6JiJpy/vIX2G4tl150sNjQfoGw YhhfMDMFpSzNS2DETj/UALAmymeKxg== X-Received: by 10.157.62.200 with SMTP id b66mr6281005otc.229.1497598717404; Fri, 16 Jun 2017 00:38:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.37.66 with HTTP; Fri, 16 Jun 2017 00:38:36 -0700 (PDT) In-Reply-To: References: <3378da1e-189a-c997-8ec8-d3d4a9afbf98@gmail.com> <8d51dc8c-fe2d-e83d-7305-d272b9fb0247@redhat.com> <2743494a-9adf-7f57-6237-9932e3e53414@gmail.com> <4dd88543-6ddf-8b11-fd20-1bbc3a5db929@redhat.com> <5be18cb1-a30c-dcf3-8ca8-7aa8d7d64198@redhat.com> <03888b4f-99f3-8139-9fa9-e7a7d344b4a9@gmail.com> <5b1bbce4-7ccd-545a-0bad-020f34350728@gmail.com> <6c9c818e-9e50-a01d-815c-0899aab71911@gmail.com> <14813e10-1b91-ee08-7bff-bdbd2a30fa77@gmail.com> <4f0fbaf6-5ffb-6ba6-7ed1-38d6b601e326@gmail.com> From: Richard Biener Date: Fri, 16 Jun 2017 07:38:00 -0000 Message-ID: Subject: Re: [PATCH] warn on mem calls modifying objects of non-trivial types (PR 80560) To: Jason Merrill Cc: Martin Sebor , Pedro Alves , Gcc Patch List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01161.txt.bz2 On Thu, Jun 15, 2017 at 11:31 PM, Jason Merrill wrote: > On Thu, Jun 15, 2017 at 12:26 PM, Martin Sebor wrote: >> On 06/12/2017 03:36 PM, Jason Merrill wrote: >>> >>> On 06/08/2017 01:25 PM, Martin Sebor wrote: >>>> >>>> + if (TREE_CHAIN (DECL_ARGUMENTS (f))) >>>> + { >>>> + /* Skip constructors that aren't copy or move ctors. */ >>>> + if (!copy_fn_p (f)) >>>> + continue; >>>> + >>>> + cpy_or_move_ctor_p =3D true; >>>> + } >>>> + else >>>> + { >>>> + /* Constructor is a default ctor. */ >>>> + cpy_or_move_ctor_p =3D false; >>>> + } >>> >>> A default constructor can have parameters, so long as they have default >>> arguments. You can use default_ctor_p to test for a default constructo= r. >> >> Thank you for the suggestion. Attached is an incremental diff >> with this tweak plus a test for it. >> >> The code above has been there in the last three revisions of >> the patch > > Yeah, I don't always notice everything :) > >> are there any other changes you'd like me to make? > > No, the patch is OK with this change. This broke build with GCC 4.8 as host compiler: g++ -fno-PIE -c -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I/space/rguenther/src/svn/early-lto-debug/gcc -I/space/rguenther/src/svn/early-lto-debug/gcc/. -I/space/rguenther/src/svn/early-lto-debug/gcc/../include -I/space/rguenther/src/svn/early-lto-debug/gcc/../libcpp/include -I/space/rguenther/src/svn/early-lto-debug/gcc/../libdecnumber -I/space/rguenther/src/svn/early-lto-debug/gcc/../libdecnumber/bid -I../libdecnumber -I/space/rguenther/src/svn/early-lto-debug/gcc/../libbacktrace -o tree-switch-conversion.o -MT tree-switch-conversion.o -MMD -MP -MF ./.deps/tree-switch-conversion.TPo /space/rguenther/src/svn/early-lto-debug/gcc/tree-switch-conversion.c /space/rguenther/src/svn/early-lto-debug/gcc/tree-switch-conversion.c: In function =E2=80=98void emit_case_bit_tests(gswitch*, tree, tree, tree, tree)=E2=80=99: /space/rguenther/src/svn/early-lto-debug/gcc/tree-switch-conversion.c:271:5= 3: warning: missing initializer for member =E2=80=98case_bit_test::mask=E2=80= =99 [-Wmissing-field-initializers] struct case_bit_test test[MAX_CASE_BIT_TESTS] =3D { }; ^ ... /space/rguenther/src/svn/early-lto-debug/gcc/tree-switch-conversion.c:271:5= 3: internal compiler error: in gimplify_init_constructor, at gimplify.c:4271 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Makefile:1102: recipe for target 'tree-switch-conversion.o' failed make: *** [tree-switch-conversion.o] Error 1 Please fix. Richard. > Jason