From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA7143858284; Fri, 23 Jun 2023 21:57:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA7143858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687557444; bh=qTS2QkCO9oAt3IExx3lw7A032mUZl+AP73JipLuDJVk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JpUkgNgwlVWbF94tBvNeCV1NkDB36JqwbBWL0P0h1yEb07Pbc0d6R5NMOwRwriL9S GpH8Q/AfSJcJSAFLJnBDbnEdkuJYwQYNyUZv0P/snPFW2Nc7EJlvJcjDyu/8Qm0Roy hU0kb67q+w8+SURuU/2P4/9xDTLMotJdeNqtiIok= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110164] Improve diagnostic for incomplete standard library types due to missing include Date: Fri, 23 Jun 2023 21:57:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110164 --- Comment #5 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:13709b518aa9769ef427e48ce5c9583fbe098777 commit r14-2055-g13709b518aa9769ef427e48ce5c9583fbe098777 Author: David Malcolm Date: Fri Jun 23 17:56:14 2023 -0400 c++: provide #include hint for missing includes [PR110164] PR c++/110164 notes that in cases where we have a forward decl of a std library type such as: std::array x; we emit this diagnostic: error: aggregate =C3=A2std::array x=C3=A2 has incomplete type = and cannot be defined This patch adds this hint to the diagnostic: note: =C3=A2std::array=C3=A2 is defined in header =C3=A2=C3=A2; = this is probably fixable by adding =C3=A2#include =C3=A2 gcc/cp/ChangeLog: PR c++/110164 * cp-name-hint.h (maybe_suggest_missing_header): New decl. * decl.cc: Define INCLUDE_MEMORY. Add include of "cp/cp-name-hint.h". (start_decl_1): Call maybe_suggest_missing_header. * name-lookup.cc (maybe_suggest_missing_header): Remove "static= ". gcc/testsuite/ChangeLog: PR c++/110164 * g++.dg/diagnostic/missing-header-pr110164.C: New test. Signed-off-by: David Malcolm =