When there are no include paths while preprocessing a header-name token,
an empty STRING_CST is returned. This patch ensures this is handled when
attempting to create a module for this name.
PR c++/107594
gcc/cp/ChangeLog:
* module.cc (get_module): Bail on empty name.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
module_state *
get_module (tree name, module_state *parent, bool partition)
{
+ /* We might be given an empty NAME if preprocessing fails to handle
+ a header-name token. */
+ if (name && TREE_CODE (name) == STRING_CST
+ && TREE_STRING_LENGTH (name) == 0)
+ return nullptr;
+
if (partition)
{
if (!parent)