From: Paolo Carlini <paolo.carlini@oracle.com>
To: Jason Merrill <jason@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ Patch] PR 52487
Date: Thu, 22 Mar 2012 17:01:00 -0000 [thread overview]
Message-ID: <4F6B5A25.2020001@oracle.com> (raw)
In-Reply-To: <4F6B3BF1.80806@redhat.com>
On 03/22/2012 03:49 PM, Jason Merrill wrote:
> It's ill-formed to have a field with incomplete type. The best thing
> would be to complain about that before we get to literal_type_p so
> that errorcount is set, if that's not too complicated.
Agreed. The problem is that if we just change check_field_decls to
produce an error about the incomplete field, we produce also another
later: that is, considering cp_parser_lambda_expression, we get to
check_field_decls from finish_struct, but we eventually also produce an
error with cxx_incomplete_type_diagnostic from build_lambda_object (->
force_rvalue -> build_special_member_call ->
complete_type_or_maybe_complain)
Anyway, I also think not calling literal_type_p from check_field_decls
if the type is incomplete is pretty ugly, but I'm not sure which is the
best way to make progress: I could try returning a boolean from
check_field_decls if something goes wrong in order to bail out early
from cp_parser_lambda_expression (at the moment, finish_struct_1,
check_bases_and_members, all return void). Or I could try to catch the
incomplete field even *before* check_field_decls.
What do you suggest?
Thanks,
Paolo.
next prev parent reply other threads:[~2012-03-22 17:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-20 15:15 Paolo Carlini
2012-03-20 19:22 ` Jason Merrill
2012-03-20 20:17 ` Paolo Carlini
2012-03-20 20:38 ` Paolo Carlini
2012-03-22 14:49 ` Jason Merrill
2012-03-22 17:01 ` Paolo Carlini [this message]
2012-03-22 17:16 ` Gabriel Dos Reis
2012-03-22 18:29 ` Jason Merrill
2012-03-23 1:02 ` Paolo Carlini
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=4F6B5A25.2020001@oracle.com \
--to=paolo.carlini@oracle.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/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: link
Be 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).