This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Don't ICE on invalid decltype uses (PR c++/34271)
- From: "Doug Gregor" <doug dot gregor at gmail dot com>
- To: "Jakub Jelinek" <jakub at redhat dot com>
- Cc: "Jason Merrill" <jason at redhat dot com>, "Mark Mitchell" <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Dec 2007 16:20:45 -0500
- Subject: Re: [C++ PATCH] Don't ICE on invalid decltype uses (PR c++/34271)
- References: <20071204192450.GF16835@devserv.devel.redhat.com>
On 12/4/07, Jakub Jelinek <jakub@redhat.com> wrote:
> As shown on the first testcase (and second as well if the parser.c
> hunk isn't applied), non-dependent SCOPE_REFs can make it into
> finish_decltype_type, which will ICE on them. On decltype9.C
> the SCOPE_REF is created from VAR_DECL in finish_id_expression:
> if (processing_template_decl && TYPE_P (scope))
> r = build_qualified_name (TREE_TYPE (r),
> scope, decl,
> template_p);
> The patch below cures this by deferring even non-dependent SCOPE_REFs
> till instantiation, at which point either diagnostics will be issued
> or they will materialize to something else, but other option is just handle
> SCOPE_REF in finish_decltype_type by issuing an error on it like we do for
> types already.
I'd rather just handle SCOPE_REF in finish_decltype_type and print the
error at that point. As a general rule, we should diagnose whatever we
can when parsing the template. Sooner or later, we're going to have to
if we want to properly support C++0x concepts.
- Doug