On Monday, 20 June 2016 at 08:10:19 UTC, Dicebot wrote:

How about defining semantics like "try inlining if possible, fallback to always emitting symbol to object file otherwise"? That would also allow compatible implementation in dmd.

My reasoning for proposing that is that for all legitimate cases I'd have to use __FILE__ as a template argument I'd also want the symbol inlined to prevent the bloat. After all CT computation such functions tend to contain 1-2 lines of runtime code only.

In LDC, Phobos functions with __FILE__ as default template parameter value are now marked with `pragma(inline, true)`, as a workaround for the larger issue of what to do with __FILE__ as template parameter.
https://github.com/ldc-developers/phobos/commit/8b2052cffe159be3db7debbe28ee967630cb4588

(the issue was preventing cross-module inlining, so a workaround was needed)

Reply via email to