This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Don't ICE on invalid decltype uses (PR c++/34271)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]