[llvm-bugs] [Bug 45828] New: Crash: templated lambda capturing another lambda object

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 7 05:38:06 PDT 2020


            Bug ID: 45828
           Summary: Crash: templated lambda capturing another lambda
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: maurimo at fb.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Created attachment 23458
  --> https://bugs.llvm.org/attachment.cgi?id=23458&action=edit
simple crash test case

Attaching a small self-conteined example that crashes Clang++ 9 through current
10/11 snapshot. Gcc 8+ appears to work fine.

clang++-9 -O0 -c -emit-llvm -std=c++2a crash.cpp

clang++-9: 9.0.0-2~ubuntu18.04.2
clang++-10: 10.0.1-++20200506082601+98f9f73f6d2-1~exp1~20200506183223.15
clang++-11: 11.0.0-++20200506063826+6d6d48add8a-1~exp1~20200506164428.1667

Inline Code:
struct Enum {
  template<typename F>
  static void eachWithIndex(F&& f) {
    f.template operator()<0, short>();
    f.template operator()<1, long>();

struct Config {
  template<typename F>
  static void enumerate(F&& f) {
    Enum::eachWithIndex([&]<int i, typename Pi>(){
      f.template operator()<i>();

int main() {
  Config::enumerate([&]<int i>(){

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200507/b180ee91/attachment-0001.html>

More information about the llvm-bugs mailing list