[Bug c++/67065] [DR 1886] Missing diagnostics for ill-formed program with main variable instead of function

2015-08-20 Thread paolo at gcc dot gnu.org
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=227027root=gccview=rev
Log:
/cp
2015-08-20  Paolo Carlini  paolo.carl...@oracle.com

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

/testsuite
2015-08-20  Paolo Carlini  paolo.carl...@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


[Bug c++/67065] [DR 1886] Missing diagnostics for ill-formed program with main variable instead of function

2015-08-20 Thread paolo.carlini at oracle dot com
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.


[Bug c++/67065] [DR 1886] Missing diagnostics for ill-formed program with main variable instead of function

2015-08-19 Thread jason at gcc dot gnu.org
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. :)