andreasfertig / cppinsights

C++ Insights - See your source code with the eyes of a compiler
https://cppinsights.io
MIT License
4.04k stars 238 forks source link

structured binding with lambda reports 'Segmentation fault' #633

Closed contestjia closed 5 months ago

contestjia commented 5 months ago

Hello Andreas,Thanks for the great tool! And there might be an issue with lambda snippets like:

#include <iostream>
#include <map>

int main(){
    std::map<int,int> a={{1,3},{4,5}};
    for(auto &[k,v] : a){
       [k]{return k;}();
    }
}

it reports error:

Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
Segmentation fault (core dumped)
andreasfertig commented 5 months ago

Hello @contestjia,

thanks for catching this issue! Looks like a C++20 update to lambdas. A fix is on its way.

Andreas