public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94571] New: Error: Expected comma or semicolon, comma found
@ 2020-04-12 23:37 bisqwit at iki dot fi
  2020-04-12 23:43 ` [Bug c++/94571] " bisqwit at iki dot fi
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bisqwit at iki dot fi @ 2020-04-12 23:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94571

            Bug ID: 94571
           Summary: Error: Expected comma or semicolon, comma found
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bisqwit at iki dot fi
  Target Milestone: ---

void foo()
{
    int test1[2], test2[2];
    auto [a,b] = test1, [c,d] = test2;
}

The error message given for this (invalid) C++17 code is a bit confusing.

tmp.cc: In function ‘void foo()’:
tmp.cc:4:23: error: expected ‘,’ or ‘;’ before ‘,’ token
    4 |     auto [a,b] = test1, [c,d] = test2;

You expected comma, found comma. So what is the problem? The proper error
message would be to only expect a semicolon.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-17 17:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-12 23:37 [Bug c++/94571] New: Error: Expected comma or semicolon, comma found bisqwit at iki dot fi
2020-04-12 23:43 ` [Bug c++/94571] " bisqwit at iki dot fi
2020-04-13 17:14 ` mpolacek at gcc dot gnu.org
2020-04-14  8:30 ` jakub at gcc dot gnu.org
2020-04-14 14:27 ` mpolacek at gcc dot gnu.org
2020-04-14 19:10 ` jakub at gcc dot gnu.org
2020-04-16  5:20 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:20 ` cvs-commit at gcc dot gnu.org
2020-09-17 17:33 ` jakub at gcc dot gnu.org

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).