https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121335
--- Comment #6 from kongmingd234 <kongmingd234 at proton dot me> --- Here is the new output of putting the includes before the imports. As you can see, the std module still has the ICE, but the main file does not, instead, there are other errors. Compiling /usr/include/vulkan/vulkan.cppm c++ -fmodules -std=c++23 -O3 /usr/include/vulkan/vulkan.cppm -c -o /dev/null Compiling /usr/local/src/gcc/installed-here/include/c++/16.0.0/bits/std.cc c++ -fmodules -std=c++23 -O3 /usr/local/src/gcc/installed-here/include/c++/16.0.0/bits/std.cc -c -o /dev/null In file included from /usr/local/src/gcc/installed-here/include/c++/16.0.0/bits/locale_facets_nonio.h:2071, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/locale:45, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/format:49, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/ostream:44, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/istream:43, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/sstream:42, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/complex:50, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/x86_64-pc-linux-gnu/bits/stdc++.h:141, from /usr/local/src/gcc/installed-here/include/c++/16.0.0/bits/std.cc:30: /usr/local/src/gcc/installed-here/include/c++/16.0.0/bits/locale_facets_nonio.tcc:42:12: internal compiler error: in lookup_mark, at cp/tree.cc:2524 42 | struct __use_cache<__moneypunct_cache<_CharT, _Intl> > | ^~~~~~~~~~~ 0x29b73cf internal_error(char const*, ...) ../.././gcc/diagnostic-global-context.cc:517 0xb1f6fb fancy_abort(char const*, int, char const*) ../.././gcc/diagnostic.cc:1810 0x895526 lookup_mark(tree_node*, bool) ../.././gcc/cp/tree.cc:2524 0xcd0bac name_lookup::dedup(bool) ../.././gcc/cp/name-lookup.cc:486 0xcd0bac name_lookup::dedup(bool) ../.././gcc/cp/name-lookup.cc:481 0xcd0bac name_lookup::search_unqualified(tree_node*, cp_binding_level*) ../.././gcc/cp/name-lookup.cc:1184 0xcd5c86 lookup_name(tree_node*, LOOK_where, LOOK_want) ../.././gcc/cp/name-lookup.cc:8131 0xce85df lookup_name(tree_node*, LOOK_want) ../.././gcc/cp/name-lookup.h:410 0xce85df cp_parser_lookup_name ../.././gcc/cp/parser.cc:33057 0xd30376 cp_parser_template_name ../.././gcc/cp/parser.cc:19945 0xd30b4a cp_parser_template_id ../.././gcc/cp/parser.cc:19552 0xd314b6 cp_parser_class_name ../.././gcc/cp/parser.cc:27449 0xd2b1c7 cp_parser_qualifying_entity ../.././gcc/cp/parser.cc:7704 0xd2b1c7 cp_parser_nested_name_specifier_opt ../.././gcc/cp/parser.cc:7390 0xd3a7a7 cp_parser_class_head ../.././gcc/cp/parser.cc:28119 0xd1b62b cp_parser_class_specifier ../.././gcc/cp/parser.cc:27570 0xd1d0cb cp_parser_type_specifier ../.././gcc/cp/parser.cc:20722 0xd3bb17 cp_parser_decl_specifier_seq ../.././gcc/cp/parser.cc:17308 0xd421c1 cp_parser_single_declaration ../.././gcc/cp/parser.cc:34027 0xd4271e cp_parser_template_declaration_after_parameters ../.././gcc/cp/parser.cc:33784 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. Compiling vulkan_first_test.cpp c++ -fmodules -std=c++23 -O3 vulkan_first_test.cpp -c -o vulkan_first_test.o vulkan_first_test.cpp: In member function ‘void HelloTriangleApplication::createLogicalDevice()’: vulkan_first_test.cpp:36:72: error: ‘physicalDevice’ was not declared in this scope; did you mean ‘VkPhysicalDevice’? 36 | std::vector<vk::QueueFamilyProperties> queueFamilyProperties = physicalDevice.getQueueFamilyProperties(); | ^~~~~~~~~~~~~~ | VkPhysicalDevice vulkan_first_test.cpp:92:146: error: designated initializers cannot be used with a non-aggregate type ‘vk::DeviceQueueCreateInfo’ 92 | eInfo deviceQueueCreateInfo { .queueFamilyIndex = graphicsIndex, .queueCount = 1, .pQueuePriorities = &queuePriority }; | ^ vulkan_first_test.cpp:92:146: error: no matching function for call to ‘vk::DeviceQueueCreateInfo::DeviceQueueCreateInfo(<brace-enclosed initializer list>)’ vulkan_first_test.cpp:93:145: error: designated initializers cannot be used with a non-aggregate type ‘vk::DeviceCreateInfo’ 93 | o deviceCreateInfo{ .pNext = &features, .queueCreateInfoCount = 1, .pQueueCreateInfos = &deviceQueueCreateInfo }; | ^ vulkan_first_test.cpp:93:145: error: no matching function for call to ‘vk::DeviceCreateInfo::DeviceCreateInfo(<brace-enclosed initializer list>)’ vulkan_first_test.cpp:97:9: error: ‘device’ was not declared in this scope; did you mean ‘VkDevice’? 97 | device = Device( physicalDevice, deviceCreateInfo ); | ^~~~~~ | VkDevice vulkan_first_test.cpp:98:9: error: ‘graphicsQueue’ was not declared in this scope 98 | graphicsQueue = Queue( device, graphicsIndex, 0 ); | ^~~~~~~~~~~~~ vulkan_first_test.cpp: In member function ‘void HelloTriangleApplication::initVulkan()’: vulkan_first_test.cpp:105:9: error: ‘setupDebugMessenger’ was not declared in this scope 105 | setupDebugMessenger(); | ^~~~~~~~~~~~~~~~~~~ vulkan_first_test.cpp:106:9: error: ‘createSurface’ was not declared in this scope 106 | createSurface(); | ^~~~~~~~~~~~~ vulkan_first_test.cpp:107:9: error: ‘pickPhysicalDevice’ was not declared in this scope; did you mean ‘VkPhysicalDevice’? 107 | pickPhysicalDevice(); | ^~~~~~~~~~~~~~~~~~ | VkPhysicalDevice vulkan_first_test.cpp: In lambda function: vulkan_first_test.cpp:145:30: error: use of deleted function ‘HelloTriangleApplication::HelloTriangleApplication()’ 145 | HelloTriangleApplication app; | ^~~ vulkan_first_test.cpp:11:7: note: ‘HelloTriangleApplication::HelloTriangleApplication()’ is implicitly deleted because the default definition would be ill-formed: 11 | class HelloTriangleApplication | ^~~~~~~~~~~~~~~~~~~~~~~~ vulkan_first_test.cpp: At global scope: vulkan_first_test.cpp:11:7: error: use of deleted function ‘vk::raii::Queue::Queue()’ In file included from /usr/include/vulkan/vulkan.cppm:23, of module vulkan_hpp, imported at vulkan_first_test.cpp:4: /usr/include/vulkan/vulkan_raii.hpp:13175:7: note: declared here 13175 | Queue() = delete; | ^~~~~ vulkan_first_test.cpp:11:7: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates 11 | class HelloTriangleApplication | ^~~~~~~~~~~~~~~~~~~~~~~~ vulkan_first_test.cpp: In lambda function: vulkan_first_test.cpp:145:30: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates 145 | HelloTriangleApplication app; | ^~~ c++ vulkan_first_test.o -o vulkan_first_test.out /usr/bin/ld: cannot find vulkan_first_test.o: No such file or directory collect2: error: ld returned 1 exit status