<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - False positive when analyzing boost/algorithm"
   href="https://bugs.llvm.org/show_bug.cgi?id=44247">44247</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>False positive when analyzing boost/algorithm
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dcoughlin@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mathstuf+llvmbugzilla@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dcoughlin@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I got this report via clang-tidy in a Boost header:

/builds/ben.boeckel/smtk/build/../smtk/attribute/Attribute.cxx:234:3: note:
Calling 'split<std::vector<std::__cxx11::basic_string<char>,
std::allocator<std::__cxx11::basic_string<char> > >, const
std::__cxx11::basic_string<char> &,
boost::algorithm::detail::is_any_ofF<char>>'
  boost::split(tree, path, boost::is_any_of(seps));
  ^
/root/misc/root/smtk-deps/include/boost/algorithm/string/split.hpp:161:17:
note: Calling 'token_finder<boost::algorithm::detail::is_any_ofF<char>>'
                ::boost::algorithm::token_finder( Pred, eCompress ) );         
                ^
/root/misc/root/smtk-deps/include/boost/algorithm/string/finder.hpp:219:55:
note: Calling copy constructor for 'is_any_ofF<char>'
            return detail::token_finderF<PredicateT>( Pred, eCompress );
                                                      ^
/root/misc/root/smtk-deps/include/boost/algorithm/string/detail/classification.hpp:114:21:
note: Taking false branch
                    if(use_fixed_storage(m_Size))
                    ^
/root/misc/root/smtk-deps/include/boost/algorithm/string/detail/classification.hpp:123:44:
note: Memory is allocated
                        m_Storage.m_dynSet=new set_value_type[m_Size];
                                           ^
/root/misc/root/smtk-deps/include/boost/algorithm/string/finder.hpp:219:55:
note: Returning from copy constructor for 'is_any_ofF<char>'
            return detail::token_finderF<PredicateT>( Pred, eCompress );
                                                      ^
/root/misc/root/smtk-deps/include/boost/algorithm/string/finder.hpp:219:55:
note: Calling '~is_any_ofF'
/root/misc/root/smtk-deps/include/boost/algorithm/string/detail/classification.hpp:135:51:
note: Left side of '&&' is false
                    if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0)
                                                  ^
/root/misc/root/smtk-deps/include/boost/algorithm/string/detail/classification.hpp:139:17:
note: Potential memory leak
                }
                ^

However, I think this is a false positive. It is assuming that
use_fixed_storage(m_Size) is both false (line 114) and later that
!use_fixed_storage(m_Size) is false (line 135). Marshall in
<a href="https://github.com/boostorg/algorithm/issues/63">https://github.com/boostorg/algorithm/issues/63</a> says it appears like a false
positive. Is this a bug in clang-analyzer or is it actually correct here
somehow?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>