[cfe-dev] "More than one static invoker operator" assertion failure on merged lambdas
Richard Smith via cfe-dev
cfe-dev at lists.llvm.org
Thu Aug 2 13:31:32 PDT 2018
On Wed, 1 Aug 2018 at 17:56, Victor Zverovich via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> Hi,
>
> I'm getting the following assertion failure on the latest clang master:
>
> clang::CXXMethodDecl* clang::CXXRecordDecl::getLambdaStaticInvoker()
> const: Assertion `Invoker.size() == 1 && "More than one static invoker
> operator!"' failed.
>
> I managed to narrow it down to the following test case which is basically
> a simplified version of
> https://github.com/llvm-mirror/clang/blob/master/test/Modules/merge-lambdas.cpp
> :
>
> $ clang++ -fmodules test.cpp
>
> // BEGIN TEST CASE (test.cpp)
> #pragma clang module build A
> module A {}
> #pragma clang module contents
> #pragma clang module begin A
> template<typename T> auto f() { return []{}; }
> #pragma clang module end
> #pragma clang module endbuild
>
> #pragma clang module build B
> module B {}
> #pragma clang module contents
> #pragma clang module begin B
> #pragma clang module import A
> inline auto x1() { return f<int>(); }
> #pragma clang module end
> #pragma clang module endbuild
>
> #pragma clang module build C
> module C {}
> #pragma clang module contents
> #pragma clang module begin C
> #pragma clang module import A
> inline auto y1() { return f<int>(); }
> #pragma clang module end
> #pragma clang module endbuild
>
> #pragma clang module import B
> #pragma clang module import C
> using T = decltype(x1);
> using T = decltype(y1);
> // END TEST CASE
>
> Should the assertion in question be relaxed or is there something missing
> in the merge to reconcile static invokers?
>
The assertion is wrong. It would be reasonable to check that all lookup
results declare the same entity, though.
Fixed in r338766. Thanks for the report!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180802/505e7b89/attachment.html>
More information about the cfe-dev
mailing list