+2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * decl.c (start_decl): Improve error location.
+ (grokdeclarator): Likewise, improve two locations.
+
2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
PR other/16615
a definition. */
if (initialized && DECL_DLLIMPORT_P (decl))
{
- error ("definition of %q#D is marked %<dllimport%>", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "definition of %q#D is marked %<dllimport%>", decl);
DECL_DLLIMPORT_P (decl) = 0;
}
/* It's common practice (and completely valid) to have a const
be initialized and declared extern. */
if (!(type_quals & TYPE_QUAL_CONST))
- warning (0, "%qs initialized and declared %<extern%>", name);
+ warning_at (DECL_SOURCE_LOCATION (decl), 0,
+ "%qs initialized and declared %<extern%>", name);
}
else
{
- error ("%qs has both %<extern%> and initializer", name);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "%qs has both %<extern%> and initializer", name);
return error_mark_node;
}
}
+2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/diagnostic/extern-initialized.C: New.
+ * g++.dg/ext/dllimport-initialized.C: Likewise.
+
2019-01-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/59345