diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-04-16 07:19:57 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-04-16 07:19:57 +0200 |
commit | e4658c7dbbe88f742c96e5f58ee4a6d549d642ca (patch) | |
tree | 870ec5cb5b974a659b7883214d0b675482394b33 /gcc/gdbhooks.py | |
parent | b8a1750a9c5c47e278d132a34a5c2e9dbb040f80 (diff) | |
download | gcc-e4658c7dbbe88f742c96e5f58ee4a6d549d642ca.zip gcc-e4658c7dbbe88f742c96e5f58ee4a6d549d642ca.tar.gz gcc-e4658c7dbbe88f742c96e5f58ee4a6d549d642ca.tar.bz2 |
c++: Fix pasto in structured binding diagnostics [PR94571]
This snippet has been copied from the non-structured binding declaration
parsing later in the function, and while for non-structured bindings
it can be followed by comma or semicolon, structured bindings may be
only followed by semicolon.
Or, do we want to have a different message for the case when there is
a comma (and keep this corrected one only if there is something else)
that would explain better what is the bug (or add a fix-it hint)?
Marek said in the PR that clang++ reports
error: decomposition declaration must be the only declaration in its group
There is another thing Marek noted (though, something for different spot),
that diagnostic for auto x(1), [e,f] = test2; could also use a clearer
wording like the above (or a fix-it hint), but the question is if we should
assume [ after , as a structured binding or if we should do some tentative
parsing first to figure out if it looks like a structured binding.
2020-04-16 Jakub Jelinek <jakub@redhat.com>
PR c++/94571
* parser.c (cp_parser_simple_declaration): Fix up a pasto in
diagnostics.
* g++.dg/cpp1z/decomp51.C: New test.
Diffstat (limited to 'gcc/gdbhooks.py')
0 files changed, 0 insertions, 0 deletions