https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120695
Bug ID: 120695 Summary: internal compiler error: in import_export_decl, at cp/decl2.cc:3569 Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rush102333 at gmail dot com Target Milestone: --- $cat test_10608.cpp template<int> struct A { static const bool x; enum { force_instantiation =! &x}; }; int g; template<int I> const bool A<1024LL>::x = (g = 1024LL, false); $g++ -fsyntax-only test_10608.cpp <source>:9:23: error: template parameters not deducible in partial specialization: [-Wtemplate-body] 9 | const bool A<1024LL>::x = (g = 1024LL, false); | ^ <source>:9:23: note: 'I' <source>:9:46: internal compiler error: in import_export_decl, at cp/decl2.cc:3569 9 | const bool A<1024LL>::x = (g = 1024LL, false); | ^ 0x2833015 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x28547a6 internal_error(char const*, ...) ???:0 0xae00bc fancy_abort(char const*, int, char const*) ???:0 0xbeebdf c_parse_final_cleanups() ???:0 0xe6db88 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. https://godbolt.org/z/sxKeEWMWE