gcc/c-family/ChangeLog: * c-warn.c (warn_for_memset): Strip any location wrappers from arg0 and arg2.
gcc/cp/ChangeLog: * parser.c (cp_parser_postfix_expression): Before warn_for_memset, strip any wrapper around "arg2" before testing for CONST_DECL. --- gcc/c-family/c-warn.c | 3 +++ gcc/cp/parser.c | 1 + 2 files changed, 4 insertions(+) diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c index 245c37d..67e6db6 100644 --- a/gcc/c-family/c-warn.c +++ b/gcc/c-family/c-warn.c @@ -1850,6 +1850,9 @@ void warn_for_memset (location_t loc, tree arg0, tree arg2, int literal_zero_mask) { + STRIP_ANY_LOCATION_WRAPPER (arg0); + STRIP_ANY_LOCATION_WRAPPER (arg2); + if (warn_memset_transposed_args && integer_zerop (arg2) && (literal_zero_mask & (1 << 2)) != 0 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 54029ef..aee211f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -7176,6 +7176,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, tree arg0 = (*args)[0]; tree arg1 = (*args)[1]; tree arg2 = (*args)[2]; + STRIP_ANY_LOCATION_WRAPPER (arg2); int literal_mask = ((!!integer_zerop (arg1) << 1) | (!!integer_zerop (arg2) << 2)); if (TREE_CODE (arg2) == CONST_DECL) -- 1.8.5.3