[lib] Drop 'inline' from 'inline constexpr' variable templates. by jensmaurer · Pull Request #4625 · cplusplus/draft (original) (raw)
@zygoloid, since const(expr) variable templates now have external linkage, it seems the "inline" is now redundant. What do you think?
I agree that removing inline
from constexpr
variable templates is a correct change. However, if I remember correctly, the LWG folks were informed that the inline
is redundant for variable templates (and it was -- arguably -- redundant before CWG2387 too, albeit for a different reason), but they wanted to keep it anyway. Seems worth checking with them.
In passing, I did a pass through the wording to double-check that inline
has no other semantic effect, and I found a bug that might be construed as causing problems with this change; here it is with suggested fix:
[module.import]/6: "A header unit shall not contain a definition of a non-inline non-template function or variable whose name has external linkage."
I'm not sure whether we'd consider that editorial, but the intent of the rule is that it only applies to declarations that allow at most one definition.