public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-110164-4-jntTxGbrcc@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-110164-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110164 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>: https://gcc.gnu.org/g:13709b518aa9769ef427e48ce5c9583fbe098777 commit r14-2055-g13709b518aa9769ef427e48ce5c9583fbe098777 Author: David Malcolm <dmalcolm@redhat.com> 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<int, 10> x; we emit this diagnostic: error: aggregate âstd::array<int, 10> xâ has incomplete type and cannot be defined This patch adds this hint to the diagnostic: note: âstd::arrayâ is defined in header â<array>â; this is probably fixable by adding â#include <array>â 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 <dmalcolm@redhat.com>
next prev parent reply other threads:[~2023-06-23 21:57 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-07 21:49 [Bug c++/110164] New: " rs2740 at gmail dot com 2023-06-07 21:56 ` [Bug c++/110164] " pinskia at gcc dot gnu.org 2023-06-13 22:51 ` dmalcolm at gcc dot gnu.org 2023-06-21 20:41 ` dmalcolm at gcc dot gnu.org 2023-06-21 20:50 ` pinskia at gcc dot gnu.org 2023-06-23 21:57 ` cvs-commit at gcc dot gnu.org [this message] 2023-06-23 22:03 ` dmalcolm at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-110164-4-jntTxGbrcc@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).