@@ -18539,12 +18539,18 @@ tsubst_copy_and_build (tree t,
bool op = CALL_EXPR_OPERATOR_SYNTAX (t);
bool ord = CALL_EXPR_ORDERED_ARGS (t);
bool rev = CALL_EXPR_REVERSE_ARGS (t);
- if (op || ord || rev)
+ bool thk = CALL_FROM_THUNK_P (t);
+ if (op || ord || rev || thk)
{
function = extract_call_expr (ret);
CALL_EXPR_OPERATOR_SYNTAX (function) = op;
CALL_EXPR_ORDERED_ARGS (function) = ord;
CALL_EXPR_REVERSE_ARGS (function) = rev;
+ if (thk)
+ {
+ /* The thunk location is not interesting. */
+ SET_EXPR_LOCATION (function, UNKNOWN_LOCATION);
+ }
}
}
@@ -1,3 +1,9 @@
+2019-02-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/89267 - change of error location.
+ * pt.c (tsubst_copy_and_build): Do still clear expr location
+ for instantiated thunk calls.
+
2019-02-08 Jason Merrill <jason@redhat.com>
PR c++/88761 - ICE with reference capture of constant.