File 0481-Fix-inadvertently-suppressed-warning-for-unused-vari.patch of Package erlang

From df0ce3328e4ac64c0bd82fb10a879d4f0732b261 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Wed, 21 Nov 2018 05:55:12 +0100
Subject: [PATCH] Fix inadvertently suppressed warning for unused variable

An external fun could inadvertently suppress warnings for
unused variables, such as in this example:

    bug() ->
        BugVar = foo(),
        if true ->
            fun m:f/1
        end.

There would be no warning that `BugVar` was unused.

The bug was introduced in ff432e262e652, which was the commit
that extended external funs to allow variables.

https://bugs.erlang.org/browse/ERL-762
---
 lib/stdlib/src/erl_lint.erl        |  3 +--
 lib/stdlib/test/erl_lint_SUITE.erl | 20 ++++++++++++++++++--
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index e9ac2fcdff..e0cd68617b 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -2262,8 +2262,7 @@ expr({'fun',Line,Body}, Vt, St) ->
 	    {[],St};
 	{function,M,F,A} ->
 	    %% New in R15.
-	    {Bvt, St1} = expr_list([M,F,A], Vt, St),
-	    {vtupdate(Bvt, Vt),St1}
+	    expr_list([M,F,A], Vt, St)
     end;
 expr({named_fun,_,'_',Cs}, Vt, St) ->
     fun_clauses(Cs, Vt, St);
-- 
2.16.4