https://github.com/spaits updated https://github.com/llvm/llvm-project/pull/76501
From c1884cc4d17c446491777baa43e3996aae22ad0d Mon Sep 17 00:00:00 2001 From: Gabor Spaits <gaborspai...@gmail.com> Date: Thu, 28 Dec 2023 14:17:55 +0100 Subject: [PATCH] [analyzer] Add documentation for std::variant checker --- clang/docs/analyzer/checkers.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst index 81d40395067c9a..272e1965335ed3 100644 --- a/clang/docs/analyzer/checkers.rst +++ b/clang/docs/analyzer/checkers.rst @@ -2097,6 +2097,21 @@ This checker is a part of ``core.StackAddressEscape``, but is temporarily disabl .. _alpha-core-TestAfterDivZero: +alpha.core.StdVariant (C++) +""""""""""""""""""""""""""" +Check if a value of active type is retrieved from an ``std::variant`` instance with ``std::get``. +In case of bad variant type access(the accessed type differs from the active type) +a warning is emitted. Currently this checker does not take exception handling into account. + +.. code-block:: cpp + + void test() { + std::variant <int, char> v = 25; + char c = stg::get<char>(v); // warn + } + +.. _alpha-core-StdVariant: + alpha.core.TestAfterDivZero (C) """"""""""""""""""""""""""""""" Check for division by variable that is later compared against 0. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits