<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/80807>80807</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            flang/lib/Semantics/data-to-inits.cpp:523:Suspicious condition
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dcb314
      </td>
    </tr>
</table>

<pre>
    Static analyser cppcheck says:

flang/lib/Semantics/data-to-inits.cpp:523:13: warning: Suspicious condition. The result of find() is an iterator, but it is not properly checked. [stlIfFind]

Source code is

        if (std::find_if(
                directs.begin(), directs.end(), [](const Symbol &component) {
                  return !IsAllocatable(component) &&
                      HasDeclarationInitializer(component);
 })) {

Checking for != 0 looks wrong because != last should be IMHO tested for.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck0-P4jgQxT-NcykRJc5fDjnQjVBzWO2Bva8cuxJq29iRXekW--lXhkbLjHouU0JF5LJ-fs_JUzHS7BAH0byIZp-plc8-DEaPVVlnozfX4cSKSYNyyl4jBtDLos-o3yGqaxTVThR7UXz1ySo3C3mwNAp5OOFFOSYdhTwYxWrDfkOOOOZ6WUS1a2Qlql2ZGnyq4MjN6fG0xoU0-TWC9s4Qk3c5_HVGCBhXy-AnmMgZIXsht0ARlANiDIp9EPIVxpWBOA2cZ1iCXzDYK9xUo8lBNC-R7XE6JEizfzZw8mvQCNobBIrPE_gqmkDIPrJJ1qtdEvI3TUnLD9seZSig5piPOJO7K04SH8v4sJEW7-9AyF57FxlO18voLQjZan9ZvEPHya_oXr4_CiAgr8GBkOUx7qz1WrEaLd6IzwTZpt8vIKneVNyjtiqodPlHR0zK0r8YfkKJ6qFFdPubiyd99_6abp3cDJMPSZmo9lCA9f49wmfwboYRtVojPoZWRYZ49qs1MCIc_3j7Exgjo0mI_E7NzFCZbbVVGQ5lV3SyLNq2yc5D22CrdYeTLrf9VnV1P5YKi1orU5l2UhkNspB1IYu22JZl0eSt6bu2N0aZph5NVYu6wIsim1v7ccl9mDOKccWhL_qiy6wa0cZbXKT8-txlSk4Y0v7NuM5R1IWlyPF_AhNbHH4nHd-FIVuDHc7Myy1-8iDkYSY-r2Ou_SXx7cfjb7ME_w9qFvJwc5EOuxn5LwAA___0qzVh">