MD_NONE, /* Not direct. */
MD_PARTITION_DIRECT, /* Direct import of a partition. */
MD_DIRECT, /* Direct import. */
- MD_PURVIEW_DIRECT, /* direct import in purview. */
+ MD_PURVIEW_DIRECT, /* Direct import in purview. */
};
/* State of a particular module. */
if (is_partition ())
{
- if (!imp->is_direct ())
- imp->directness = MD_PARTITION_DIRECT;
+ if (!imp->is_direct () && !imp->is_partition_direct ())
+ {
+ imp->directness = MD_PARTITION_DIRECT;
+ linemap_module_reparent (line_table, imp->loc, floc);
+ }
if (exportedness > 0)
imp->exported_p = true;
}
--- /dev/null
+// PR c++/124309
+// { dg-additional-options "-fmodules" }
+
+import Z;
+
+int main() {
+ frob(2); // { dg-error "invalid conversion" }
+}
+
+// { dg-regexp "In module X, imported at \[^\n]*part-11_c.C:6,\n\\\s*included from \[^\n]*part-11_d.C:7,\nof module Z, imported at \[^\n]*part-11_e.C:4:\n\[^\n]*part-11_a.C:7:18: note:.*" }