llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[clang] assertion `isDependentContext() && "cannot iterate dependent diagnostics of non-dependent context"' failed

Open inclyc opened this issue 3 years ago • 2 comments

https://godbolt.org/z/EPrvvnfze

This crash is what I found while working on https://github.com/llvm/llvm-project/issues/57155.

//                  |              |
//                  v              v
int(*f)(int) = [](auto t) -> decltype([] { 
    return 0; 
    } ()
){ 
    return t; 
};

It looks like we didn't handle the logic of lambda expressions in decltype and auto parameters. Lambdas in unevaluated contexts is a C++20 core language feature that we partially implemented. See P0315R4

Related to https://github.com/llvm/llvm-project/issues/57155 https://github.com/llvm/llvm-project/issues/45822

inclyc avatar Aug 16 '22 06:08 inclyc

@llvm/issue-subscribers-clang-frontend

llvmbot avatar Aug 16 '22 06:08 llvmbot

@llvm/issue-subscribers-c-2b

llvmbot avatar Aug 16 '22 06:08 llvmbot

@llvm/issue-subscribers-c-20

llvmbot avatar Aug 23 '22 22:08 llvmbot

I believe this is fixed after https://github.com/llvm/llvm-project/commit/ea4fd668c2cd88d13b36a5d64e3dedb1106340bc.

v1nh1shungry avatar Jan 23 '23 02:01 v1nh1shungry

Thanks!

inclyc avatar Jan 23 '23 03:01 inclyc