On 2015.08.21 at 08:18 +0200, Markus Trippelsdorf wrote: > On 2015.08.19 at 21:46 +0200, Paolo Carlini wrote: > > Hi, > > > > submitter noticed that, in violation of [basic.start.main], we don't > > reject as ill-formed the declaration of a 'main' variable in the global > > namespace. Not a big deal IMHO, but the below simple check works well > > for me on x86_64-linux. > > Well, it breaks building Firefox for example (several violations). > I'm not sure this is really worth the hassle. Maybe a warning instead of > an error would be acceptable?
For example: % echo "void foo() { int main; }" | g++ -c -x c++ - <stdin>: In function ‘void foo()’: <stdin>:1:18: error: cannot declare ‘::main’ to be a global variable -- Markus