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

--- Comment #1 from terryinzaghi <terryinzaghi at 163 dot com> ---
(In reply to terryinzaghi from comment #0)
> /*using  gcc 14.2 */
> /*sample code will trigger the error: */
> 
> 
> template<typename Task,auto name> struct Cask {
>     Cask()  {  std::cout<< name() << " start" << std::endl                 
> ;}
>     ~Cask() { (*std::launder(reinterpret_cast<Task*>(this)))(name());}
> };
> struct Task {
>    struct T0 : Cask<Task, ([]{return("t0");})>        {
>       //static constexpr auto
> Any_Thing_End_With_Block_Just_Hold_The_First_Line = []{};
>       //--- without this line:   internal compiler error: in
> convert_nontype_argument, at cp/pt.cc:7881
>       //--- 0x9387ae lookup_template_class(tree_node*, tree_node*,
> tree_node*, tree_node*, int, int)
>       Cask<Task, ([]{return("c00");}) > c00{};
>       Cask<Task, ([]{return("c01");}) > c01{};
>    } t0;
>    struct T1 : Cask<Task,([]{return("t1");})>         {
>       Cask<Task, ([]{return("c10");})> c10{};
>       Cask<Task, ([]{return("c11");})> c11{};
>    } t1;
>    void operator()(const char* msg) {std::cout<< "top received "<< msg <<
> std::endl;}
> };
> 
> /* it Maybe  Same as  101430 */
> /* it NOT happend IF using gcc 13.x*/

Reply via email to