public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jg at jguk dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/109356] Enhancement idea to provide clearer missing brace line number
Date: Sun, 09 Apr 2023 20:10:45 +0000 [thread overview]
Message-ID: <bug-109356-4-u3bqU96CLw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109356-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109356
--- Comment #8 from Jonny Grant <jg at jguk dot org> ---
(In reply to Xi Ruoyao from comment #7)
> (In reply to Jonny Grant from comment #6)
> > Tried a few other compilers on godbolt.
> >
> > ICC gets the warning on line 6
> > https://godbolt.org/z/fYb9c8f61
> >
> > nvc++ gives the warning on line 6
> > https://godbolt.org/z/xvh67odzY
> >
> > MSVC and Clang don't.
>
> This is just blind luck. All of these compilers attempt to "fix" the syntax
> error by adding "}" at line 8 (not line 6!) and produce further warnings.
> It's just ICC and nvc++ report "excess elements in initializer" at the
> beginning of the initializer, while the other compilers report it at the end.
>
> Strictly speaking all of them are false warnings as there is no excess
> elements in the initializer (according to the programmer's mind). But the
> only thing the parser can do is guessing the programmer wanted a "}" at line
> 8.
ok, thank you for your further replies
prev parent reply other threads:[~2023-04-09 20:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-31 10:00 [Bug c++/109356] New: " jg at jguk dot org
2023-03-31 10:17 ` [Bug c++/109356] " redi at gcc dot gnu.org
2023-03-31 10:50 ` xry111 at gcc dot gnu.org
2023-03-31 19:52 ` jg at jguk dot org
2023-04-04 20:31 ` jg at jguk dot org
2023-04-05 9:22 ` xry111 at gcc dot gnu.org
2023-04-06 22:19 ` jg at jguk dot org
2023-04-08 14:57 ` jg at jguk dot org
2023-04-09 9:04 ` xry111 at gcc dot gnu.org
2023-04-09 20:10 ` jg at jguk dot org [this message]
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-109356-4-u3bqU96CLw@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: 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).