/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.
From-SVN: r227027
+2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/67065
+ * decl.c (grokvardecl): Reject 'main' as global variable.
+
2015-08-19 Jason Merrill <jason@redhat.com>
PR c++/66957
else
DECL_INTERFACE_KNOWN (decl) = 1;
+ if (DECL_NAME (decl)
+ && MAIN_NAME_P (DECL_NAME (decl))
+ && CP_DECL_CONTEXT (decl) == global_namespace)
+ error ("cannot declare %<::main%> to be a global variable");
+
/* Check that the variable can be safely declared as a concept.
Note that this also forbids explicit specializations. */
if (conceptp)
+2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/67065
+ * g++.dg/other/pr67065.C: New.
+
2015-08-20 Simon Dardis <simon.dardis@imgtec.com>
- * gcc.target/mips/inline-memcpy-1.c: Test for inline expansion of memcpy.
+ * gcc.target/mips/inline-memcpy-1.c: Test for inline expansion of
+ memcpy.
* gcc.target/mips/inline-memcpy-2.c: Ditto.
* gcc.target/mips/inline-memcpy-3.c: Ditto.
* gcc.target/mips/inline-memcpy-4.c: Ditto.
--- /dev/null
+// PR c++/67065
+
+int main; // { dg-error "cannot declare" }