[PATCH] Allow string literals as module identifiers
dgregor at apple.com
Thu Oct 31 10:02:21 PDT 2013
Sorry for the slow reply, but it seems like a net loss to generalize the simple identifier-based module naming scheme to full string literals, because we're making the mental model more complex ("when do I use / in a string literal vs. a submodule?"). The automatic mapping from header names to module names is a convenience that helps one avoid writing module maps for everything. When the automatic mapping "fails" because the header name isn't an identifier, I think it's reasonable to either (1) require that the user provide an identifier to name the (sub)module corresponding to that header, or (2) sanitize the name in some way to make it an identifier. In particular, I don't think it's important at all for the unmodified header name to be namable from an (@)import declaration, since one can continue using #include until a suitable name is chosen for the (sub)module.
More information about the cfe-commits