[Bug c++/118245] New: internal compiler error: in convert_nontype_argument, at cp/pt.cc:7881 WHEN use lambda AS template-arg
terryinzaghi at 163 dot com
gcc-bugzilla@gcc.gnu.org
Mon Dec 30 11:11:27 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118245
Bug ID: 118245
Summary: internal compiler error: in convert_nontype_argument,
at cp/pt.cc:7881 WHEN use lambda AS template-arg
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: terryinzaghi at 163 dot com
Target Milestone: ---
/*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*/
More information about the Gcc-bugs
mailing list