Open tonyelewis opened 9 months ago
@llvm/issue-subscribers-clang-static-analyzer
Author: Tony E Lewis (tonyelewis)
Thanks for the report. Here is the compiler-explorer repro. This bug is present for a long time, at least since clang-16.
The assertion is from ExprEngine::handleConstructor
, which is called with a Delegating constructor, where we cast the LCtx->getDecl()
into a CXXMethodDecl
, but it's actually only a FunctionDecl
("f" in the example), thus asserting on llvm::cast
.
I don't think it's difficult to fix, but I don't really have the time now.
Thanks again for the tiny repro!
Thanks for the quick response and the assessment of the problem.
Thanks again for the tiny repro!
creduce
is a wonderful thing. :slightly_smiling_face:
Running
clang-tidy a.cpp -checks= -- -x c++ -std=c++20
with up to date build (987087df90026605fc8d03ebda5a1cd31b71e609, 2024-01-23) on:…(which I think is valid code and which is accepted by
clang++
) segfaults:Note that the source line containing a deduction guide isn't necessary to trigger the crash on trunk, but on slightly older versions it prevents a report of a deduction error from masking the segfault.