https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70730
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic, easyhack Status|UNCONFIRMED |NEW Last reconfirmed| |2016-04-19 CC| |manu at gcc dot gnu.org Depends on| |43486 Ever confirmed|0 |1 --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- manu@localhost:~/gcc/gcc/c-family$ grep -C 3 "attempt to take address of" *.c c-common.c- t = TREE_OPERAND (expr, 1); c-common.c- if (DECL_C_BIT_FIELD (t)) c-common.c- { c-common.c: error ("attempt to take address of bit-field structure " c-common.c- "member %qD", t); c-common.c- return error_mark_node; c-common.c- } error() uses "input_location" and that may point to anything. You need to use error_at(), with the proper location of the second operand. (I'm not sure if the second operand always have a proper location. If not, this then depends on PR43486) Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43486 [Bug 43486] Preserve variable-use locations