/cp
2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokvardecl): Use an accurate location in error message
about main as a global variable.
/testsuite
2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/diagnostic/main1.C: New.
From-SVN: r271070
+2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * decl.c (grokvardecl): Use an accurate location in error message
+ about main as a global variable.
+
2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
if (DECL_NAME (decl)
&& MAIN_NAME_P (DECL_NAME (decl))
&& scope == global_namespace)
- error ("cannot declare %<::main%> to be a global variable");
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "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. */
+2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/diagnostic/main1.C: New.
+
2019-05-10 Marek Polacek <polacek@redhat.com>
PR c++/78010 - bogus -Wsuggest-override warning on final function.
--- /dev/null
+int main __attribute__((unused)); // { dg-error "5:cannot declare" }