https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104137

            Bug ID: 104137
           Summary: ICE when lambda has parameter of decltype of a
                    non-convertable lambda
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

The following lambda has a wrong parameter type of non-convertible lambda and 
causes ICE: (with -std=c++20)
void test2(){
    // this has wrong type parameter
    return [](decltype([](){})){        
    }([](){});
}



The correct parameter type is convertible lambda and compiling has no issue

void test1(){
    // this has correct parameter
    return [](decltype(+[](){})){        
    }([](){});
}

https://www.godbolt.org/z/fbcr16jv4

Reply via email to