diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2023-02-27 13:57:48 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2023-02-27 14:34:22 +0100 |
commit | 443c249d85003639512d8d3b6ace184a9ff53bc2 (patch) | |
tree | 073c9bf02bb377f56606cd0352f9d301ccfb1802 /test/lisp/emacs-lisp | |
parent | 10d2b76edadb6575545433ea6183c4d8e8588191 (diff) | |
download | emacs-443c249d85003639512d8d3b6ace184a9ff53bc2.tar.gz |
Warn about `condition-case` without handlers
Omitting handlers from a `condition-case` form makes it useless
since no errors are caught.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): New warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
* etc/NEWS: Announce.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 185abaf5c22..b6dcfeedb0c 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1447,6 +1447,12 @@ literals (Bug#20852)." "Warning: Use .with-current-buffer. rather than") (test-suppression + '(defun zot (x) + (condition-case nil (list x))) + '((suspicious condition-case)) + "Warning: `condition-case' without handlers") + + (test-suppression '(defun zot () (let ((_ 1)) )) |