public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67013] New: Compilation error for well-formed program with empty declaration in the global namespace
@ 2015-07-26  0:46 anders.granlund.0 at gmail dot com
  2015-07-26  1:17 ` [Bug c++/67013] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2015-07-26  0:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67013
           Summary: Compilation error for well-formed program with empty
                    declaration in the global namespace
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Consider the following program:

  int main() {};

It is well-formed, the extra semi colon is just an empty declaration after the
definition of main.

Compile it with the following command line:

  g++ prog.cc -std=c++14 -pedantic-errors

The following error message is then given:

  prog.cc:1:14: error: extra ';' [-Wpedantic]
  int main() {};
              ^

I expected to get no error messages since the program is well-formed. For
comparison Clang gives no error message.

I have tried it with gcc HEAD 6.0.0 201507 here:

  http://melpon.org/wandbox/permlink/gaOys1DxBYMnRWei


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

end of thread, other threads:[~2021-12-07  5:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-26  0:46 [Bug c++/67013] New: Compilation error for well-formed program with empty declaration in the global namespace anders.granlund.0 at gmail dot com
2015-07-26  1:17 ` [Bug c++/67013] " pinskia at gcc dot gnu.org
2015-07-26 12:36 ` anders.granlund.0 at gmail dot com
2015-07-26 20:31 ` redi at gcc dot gnu.org
2015-07-26 20:36 ` anders.granlund.0 at gmail dot com
2015-07-26 20:39 ` pinskia at gcc dot gnu.org
2015-07-26 20:41 ` pinskia at gcc dot gnu.org
2015-07-26 20:42 ` pinskia at gcc dot gnu.org
2015-07-26 20:46 ` pinskia at gcc dot gnu.org
2015-07-26 20:46 ` pinskia at gcc dot gnu.org
2015-07-26 20:47 ` pinskia at gcc dot gnu.org
2021-12-07  5:13 ` [Bug c++/67013] [DR569] " pinskia 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).