https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101717
Steven Sun <StevenSun2021 at hotmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |StevenSun2021 at hotmail dot com --- Comment #3 from Steven Sun <StevenSun2021 at hotmail dot com> --- This bug is not introduced in GCC 12. The relevant code fragment is last edited by g:91e534b0d in `gcc/cp/lambda.c` ``` gcc_checking_assert (init && (TREE_TYPE (TREE_TYPE (init)) == current_nonlambda_class_type ())); ``` The assertion fails since long ago. (init == 0 in this case) Before GCC 12, the `gcc_checking_assert` is `(void)0` in release version, leaving everything fine. Somehow `gcc_checking_assert` starts working now, and aborts the program. My insight on the problem: The program seems never think of a situation "a lambda inside a lambda inside a NSDMI`. We need to amend the logic here. "here" means https://gcc.gnu.org/git?p=gcc.git;a=blob;f=gcc/cp/lambda.c;h=2e9d38bbe832702804ddcaffc4024ce930a74843;hb=refs/heads/master#l755 By the way, does anyone know other magics like g:hash?