From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7DFA13858C1F for ; Thu, 15 Jun 2023 11:54:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DFA13858C1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686830057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ulAbjhD0af8aqS6AGzXdLI0hpRjWiuTTSbUi+LU0A9o=; b=TE5DqjPPYdngvKWqoFSr/MiWXgDwDG0lv136mxleRAM+Kr5zW8MksrvS8fpa70Enkw5VCp /EL3c13Mv3pM1ijPeTmXR+tcjQVGQ13SuqZuE0oFN2tnGG1LQfH3RGdDRYe7R06LwImqhk L6O0WCnZN6n0+FCRmFvOmr3l750B0rc= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-ASJxK-saO0mOF3MEeP1JsA-1; Thu, 15 Jun 2023 07:54:16 -0400 X-MC-Unique: ASJxK-saO0mOF3MEeP1JsA-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-75d4e8bf725so430289585a.0 for ; Thu, 15 Jun 2023 04:54:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686830055; x=1689422055; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ulAbjhD0af8aqS6AGzXdLI0hpRjWiuTTSbUi+LU0A9o=; b=GtdSDf1sEJyGDz0p35G7hA5gIhMOcpGt/4V+UyNwAidjNAs8L9ML/CvJ4m/LOBoU97 l+s2oYxo7vOqzOfjzKOappS5k3/a8Vpy2YXLTKajEPgcpbJ569GRAU0OukgzMqk6XbQf suQyonYMxGDqbpPwdr95EJA4v0sT3UcukOBZ9yIHfk+XNJcLQAgh9/PcwCvv6oRI+ZH/ 4gfZRTWLnvDIopgnCsc/MYzi/8z5IqPBbO+gYaflpc2WuNebBpx/bPticX25nfhXQVw8 Hogs/TrEL4rxsacUAWxfw30C2zK19G2jmNaK/9z6bnziuc1+58owFBrwIsCh003S5bmw 6kLw== X-Gm-Message-State: AC+VfDwj11LtlvWMEEY24A+2idxcCvWU+ULPlFNCTsLv2gTkyxKVyOnf gNMfhyd/LvF/vOejY5+D0gBjNtyqIJQdIHfG1l6MUVodHC98XBx7U8gFOS0YWS1OEl1ID1KG6gc Q3koArN92sE5vZBWduuf9pe0N9w== X-Received: by 2002:a05:620a:4899:b0:760:7913:e5d8 with SMTP id ea25-20020a05620a489900b007607913e5d8mr13029392qkb.78.1686830055458; Thu, 15 Jun 2023 04:54:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6go6Xsp7NQlmqmHvN3A/DkahyZQzsd2s/zidd+jguvdmxGRDHS0jTyuxsPBDJtmwFJEbuDEA== X-Received: by 2002:a05:620a:4899:b0:760:7913:e5d8 with SMTP id ea25-20020a05620a489900b007607913e5d8mr13029380qkb.78.1686830055218; Thu, 15 Jun 2023 04:54:15 -0700 (PDT) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id i15-20020a05620a074f00b0075ed10554a5sm3192519qki.11.2023.06.15.04.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 04:54:14 -0700 (PDT) Message-ID: <7198bdfadb86de4d8f6492bd1e81bd3e26d677bb.camel@redhat.com> Subject: Re: [PATCH] c++: provide #include hint for missing includes [PR110164] From: David Malcolm To: Sam James , Eric Gallager Cc: gcc-patches@gcc.gnu.org Date: Thu, 15 Jun 2023 07:54:13 -0400 In-Reply-To: <87o7lhv9h8.fsf@gentoo.org> References: <20230615002814.967814-1-dmalcolm@redhat.com> <87o7lhv9h8.fsf@gentoo.org> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 2023-06-15 at 01:43 +0100, Sam James wrote: >=20 > Eric Gallager via Gcc-patches writes: >=20 > > On Wed, Jun 14, 2023 at 8:29=E2=80=AFPM David Malcolm via Gcc-patches > > wrote: > > >=20 > > > PR c++/110164 notes that in cases where we have a forward decl > > > of a std library type such as: > > >=20 > > > std::array x; > > >=20 > > > we omit this diagnostic: > > >=20 > > > error: aggregate =E2=80=98std::array x=E2=80=99 has incomple= te type and > > > cannot be defined > > >=20 > > > This patch adds this hint to the diagnostic: > > >=20 > > > note: =E2=80=98std::array=E2=80=99 is defined in header =E2=80=98=E2=80=99; this is > > > probably fixable by adding =E2=80=98#include =E2=80=99 > > >=20 > >=20 > > ..."probably"? > >=20 >=20 > Right now, our fixit says: > ``` > /tmp/foo.c:1:1: note: =E2=80=98time_t=E2=80=99 is defined in header =E2= =80=98=E2=80=99; did > you forget to =E2=80=98#include =E2=80=99? > ``` >=20 > We should probably use the same phrasing for consistency? It's using the same phrasing (it's calling the same function); I changed the wording recently, in r14-1798-g7474c46cf2d371: https://gcc.gnu.org/pipermail/gcc-patches/2023-June/621607.html I used "probably" because there's no guarantee it will fix things (e.g. if the user has non-standard headers). Dave