Subject: bug#15327: 24.3; Incorrect "Unused lexical variable" warning with avl-tree-create

From: Stefan Monnier <[email-masked]>
Date: Tue, 10 Sep 2013 17:08:03 -0400

> Sorry, I accidentally hit send early. If the above is compiled,

>     $ emacs -Q -batch -f batch-byte-compile tmp.el
>     In toplevel form:
>     tmp.el:3:1:Warning: Unused lexical variable `cmpfun'
>     Wrote /tmp/tmp.elc

> Due to improper macro expansion of avl-tree-create by defstruct,

>     (let
>         ((cmpfun #'string<))
>       (progn
>         (vector 'cl-struct-avl-tree-
>                 (progn
>                   (vector nil nil nil 0))
>                 #'string<)))

IIUC I fixed this recently in the trunk (the bug was in the expander
part of cl-defsubst).

        Stefan