public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function
       [not found] <bug-67065-4@http.gcc.gnu.org/bugzilla/>
@ 2015-07-30 12:05 ` redi at gcc dot gnu.org
  2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2015-07-30 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-07-30
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Anders Granlund from comment #0)
> The following program is ill-formed (proc.cc):
> 
>   int main;
> 
> Compile it with the following command line:
> 
>   clang++ prog.cc -std=c++14 -pedantic-errors


Erm :-)


It fails with G++ too though.


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

* [Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function
       [not found] <bug-67065-4@http.gcc.gnu.org/bugzilla/>
  2015-07-30 12:05 ` [Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function redi at gcc dot gnu.org
  2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
@ 2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
  2015-08-20  2:03 ` [Bug c++/67065] [DR 1886] " jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2015-07-31  0:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Anders Granlund <anders.granlund.0 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> (In reply to Anders Granlund from comment #0)
> > The following program is ill-formed (proc.cc):
> > 
> >   int main;
> > 
> > Compile it with the following command line:
> > 
> >   clang++ prog.cc -std=c++14 -pedantic-errors
> 
> 
> Erm :-)
> 
> 
> It fails with G++ too though.

Lol. Don't worry, GCC is still my favourite compiler bug generator. :P


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

* [Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function
       [not found] <bug-67065-4@http.gcc.gnu.org/bugzilla/>
  2015-07-30 12:05 ` [Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function redi at gcc dot gnu.org
@ 2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
  2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2015-07-31  0:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Anders Granlund <anders.granlund.0 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> (In reply to Anders Granlund from comment #0)
> > The following program is ill-formed (proc.cc):
> > 
> >   int main;
> > 
> > Compile it with the following command line:
> > 
> >   clang++ prog.cc -std=c++14 -pedantic-errors
> 
> 
> Erm :-)
> 
> 
> It fails with G++ too though.

Lol. Don't worry, GCC is still my favourite compiler bug generator. :P


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

* [Bug c++/67065] [DR 1886] Missing diagnostics for ill-formed program with main variable instead of function
       [not found] <bug-67065-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
@ 2015-08-20  2:03 ` jason at gcc dot gnu.org
  2015-08-20 10:18 ` paolo at gcc dot gnu.org
  2015-08-20 10:20 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2015-08-20  2:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
            Summary|Missing diagnostics for     |[DR 1886] Missing
                   |ill-formed program with     |diagnostics for ill-formed
                   |main variable instead of    |program with main variable
                   |function                    |instead of function

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Anders Granlund from comment #0)
> The program is ill-formed by following sentence in [basic.start.main]p3
> (http://eel.is/c++draft/basic.start.main#3):
> 
> "A program that declares a variable main at global scope or that declares
> the name main with C language linkage (in any namespace) is ill-formed."

This sentence only exists in the most recent draft, so I'm not surprised it
isn't widely implemented yet. :)


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

* [Bug c++/67065] [DR 1886] Missing diagnostics for ill-formed program with main variable instead of function
       [not found] <bug-67065-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-08-20  2:03 ` [Bug c++/67065] [DR 1886] " jason at gcc dot gnu.org
@ 2015-08-20 10:18 ` paolo at gcc dot gnu.org
  2015-08-20 10:20 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-08-20 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Thu Aug 20 10:18:03 2015
New Revision: 227027

URL: https://gcc.gnu.org/viewcvs?rev=227027&root=gcc&view=rev
Log:
/cp
2015-08-20  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/67065
        * decl.c (grokvardecl): Reject 'main' as global variable.

/testsuite
2015-08-20  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/67065
        * g++.dg/other/pr67065.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/other/pr67065.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/67065] [DR 1886] Missing diagnostics for ill-formed program with main variable instead of function
       [not found] <bug-67065-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-08-20 10:18 ` paolo at gcc dot gnu.org
@ 2015-08-20 10:20 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-08-20 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.


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

end of thread, other threads:[~2015-08-20 10:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-67065-4@http.gcc.gnu.org/bugzilla/>
2015-07-30 12:05 ` [Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function redi at gcc dot gnu.org
2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
2015-07-31  0:54 ` anders.granlund.0 at gmail dot com
2015-08-20  2:03 ` [Bug c++/67065] [DR 1886] " jason at gcc dot gnu.org
2015-08-20 10:18 ` paolo at gcc dot gnu.org
2015-08-20 10:20 ` paolo.carlini at oracle dot com

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