<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 - Assertion failure in create_call_once_funcptr_call()"
   href="https://bugs.llvm.org/show_bug.cgi?id=37312">37312</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure in create_call_once_funcptr_call()
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>ekarpenkov@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alexfh@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dcoughlin@apple.com, ganna@apple.com, llvm-bugs@lists.llvm.org, noqnoqneo@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat test-CFGBuilder__appendCall.cc
namespace std {
struct a {
  int _M_once;
};
template <typename b, typename... c>
void call_once(b &&, c &&...);
}  // namespace std
class d {
  typedef void (*e)(int *, d *);
  int f;
  void g() { call_once(h, i, &f, this); }
  e i;
  std::a h;
};
$ ./clang-tidy -checks=-*,clang-analyzer* test-CFGBuilder__appendCall.cc --
-std=c++11 -fsized-deallocation -Wno-everything
assert.h assertion failed at llvm/tools/clang/lib/AST/Expr.cpp:1570 in bool
clang::CastExpr::CastConsistency() const:
getSubExpr()->getType()->isFunctionType()
    @     0x5627c34d9c56  __assert_fail
    @     0x5627c22b2036  clang::CastExpr::CastConsistency()
    @     0x5627c1961767  clang::CastExpr::CastExpr()
    @     0x5627c22b25f4  clang::ImplicitCastExpr::Create()
    @     0x5627c1e8f8dd  create_call_once_funcptr_call()
    @     0x5627c1e8e2b2  create_call_once()
    @     0x5627c1e8d274  clang::BodyFarm::getBody()
    @     0x5627c1e83fa4  clang::AnalysisDeclContext::getBody()
    @     0x5627c1273a48  clang::ento::AnyFunctionCall::getRuntimeDefinition()
    @     0x5627c12cd3b6  clang::ento::ExprEngine::defaultEvalCall()
    @     0x5627c1288429  clang::ento::CheckerManager::runCheckersForEvalCall()
    @     0x5627c12cbf33  clang::ento::ExprEngine::evalCall()
    @     0x5627c12cbcc2  clang::ento::ExprEngine::VisitCallExpr()
    @     0x5627c1299633  clang::ento::ExprEngine::Visit()
    @     0x5627c12953ae  clang::ento::ExprEngine::ProcessStmt()
    @     0x5627c12950cb  clang::ento::ExprEngine::processCFGElement()
    @     0x5627c12b99c5  clang::ento::CoreEngine::HandlePostStmt()
    @     0x5627c12b8e1d  clang::ento::CoreEngine::ExecuteWorkList()
    @     0x5627c0fed7ac  (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
    @     0x5627c0fed326  (anonymous namespace)::AnalysisConsumer::HandleCode()
    @     0x5627c0fd9094  (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()</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>