On 11/10/2017 04:45 PM, David Malcolm wrote:
gcc/c-family/ChangeLog:
        * c-format.c (check_format_arg): Strip any location wrapper around
        format_tree.
---
  gcc/c-family/c-format.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 164d035..6b436ec 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -1536,6 +1536,8 @@ check_format_arg (void *ctx, tree format_tree,
location_t fmt_param_loc = EXPR_LOC_OR_LOC (format_tree, input_location); + STRIP_ANY_LOCATION_WRAPPER (format_tree);
+
    if (VAR_P (format_tree))
      {
        /* Pull out a constant value if the front end didn't.  */

It seems like we want fold_for_warn here instead of the special variable handling. That probably makes sense for the other places you change in this patch, too.

Jason

Reply via email to