A trivial patch to use LOC for atomic bit-fields error messages.
I haven't bothered with a testcase this time.

Bootstrapped/regtested on x86_64-linux, applying to trunk.

2015-08-12  Marek Polacek  <pola...@redhat.com>

        * c-decl.c (grokdeclarator): Call error_at instead of error and pass
        LOC to it.

diff --git gcc/c/c-decl.c gcc/c/c-decl.c
index 0d7aa3f..b83c584 100644
--- gcc/c/c-decl.c
+++ gcc/c/c-decl.c
@@ -6233,9 +6233,9 @@ grokdeclarator (const struct c_declarator *declarator,
       if (type_quals & TYPE_QUAL_ATOMIC)
        {
          if (name)
-           error ("bit-field %qE has atomic type", name);
+           error_at (loc, "bit-field %qE has atomic type", name);
          else
-           error ("bit-field has atomic type");
+           error_at (loc, "bit-field has atomic type");
          type_quals &= ~TYPE_QUAL_ATOMIC;
        }
     }

        Marek

Reply via email to