https://bugs.llvm.org/show_bug.cgi?id=45828

            Bug ID: 45828
           Summary: Crash: templated lambda capturing another lambda
                    object
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

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.

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

Versions:
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to