On 01/05/2018 05:20 PM, David Malcolm wrote:
On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote:
On 12/29/2017 12:06 PM, David Malcolm wrote:
@@ -24998,6 +25018,8 @@ build_non_dependent_expr (tree expr)
        && !expanding_concept ())
      fold_non_dependent_expr (expr);
+ STRIP_ANY_LOCATION_WRAPPER (expr);

Why is this needed?

I added this to fix a failure:

template argument deduction/substitution failed:
note:   cannot convert ‘0’ (type ‘int’) to type ‘char**’

seen building the precompiled header, where build_non_dependent_expr
adds a NON_DEPENDENT_EXPR around a location wrapper around an
INTEGER_CST, whereas without location wrappers we'd just have an
INTEGER_CST.

build_non_dependent_expr performs various tests for exact TREE_CODEs,
special-casing constants; without the stripping these TREE_CODE tests
don't match when the constants have location wrappers, leading to the
failure.

Makes sense. But we're losing the location information here; in cases where we return the expression unchanged we ought to return the expression with its location wrapper intact.

Jason

Reply via email to