PR c/70791
* c-decl.c (pushdecl): Pass LOCUS down to warning.
* gcc.dg/Wnested-externs-2.c: New test.
From-SVN: r235447
(c_parser_switch_statement): Use it.
(c_parser_while_statement): Use it.
+ PR c/70791
+ * c-decl.c (pushdecl): Pass LOCUS down to warning.
+
2016-04-20 Ilya Verbin <ilya.verbin@intel.com>
PR c++/69363
}
if (scope != file_scope
&& !DECL_IN_SYSTEM_HEADER (x))
- warning (OPT_Wnested_externs, "nested extern declaration of %qD", x);
+ warning_at (locus, OPT_Wnested_externs,
+ "nested extern declaration of %qD", x);
while (b && !B_IN_EXTERNAL_SCOPE (b))
{
* gcc.dg/pr67784-4.c: New test.
* gcc.dg/pr67784-5.c: New test.
+ PR c/70791
+ * gcc.dg/Wnested-externs-2.c: New test.
+
2016-04-26 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/fold-plusmult.c: Adjust.
--- /dev/null
+/* PR c/70791 */
+/* { dg-do compile } */
+/* { dg-options "-Wnested-externs" } */
+
+void
+bar (void)
+{
+ extern int i; /* { dg-warning "14:nested extern declaration of 'i'" } */
+ extern short foo (void); /* { dg-warning "16:nested extern declaration of 'foo'" } */
+ extern struct S *s; /* { dg-warning "20:nested extern declaration of 's'" } */
+}