From 62aeafd2e209b70981f2e38569f4e0e15e5f9814 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 1 Sep 2016 17:28:37 -0400 Subject: [PATCH] tweak error message for exhausted-overloaded-functions Correct the error message generated for "all functions exhausted" to focus on the token of the function-call site, rather than whatever inner statement was last executed before a "next". --- translate.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/translate.cxx b/translate.cxx index 73efcb95e..118ba1e02 100644 --- a/translate.cxx +++ b/translate.cxx @@ -5564,7 +5564,10 @@ c_unparser::visit_functioncall (functioncall* e) if (e->referents.back()->has_next) // check for aborted return from function; this could happen from non-overloaded ones too - o->newline() << "if (unlikely(c->next)) { c->last_error = \"all functions exhausted\"; goto out; }"; + o->newline() + << "if (unlikely(c->next)) { " + << "c->last_stmt = " << lex_cast_qstring(*e->tok) << "; " + << "c->last_error = \"all functions exhausted\"; goto out; }"; // return result from retvalue slot NB: this must be last, for the // enclosing statement-expression ({ ... }) to carry this value. -- 2.43.5