The documentation for enforceEx shows this problem: http://dlang.org/phobos/std_exception.html#.enforceEx
__FILE__ and __LINE__ are used in the template constraint, but unfortunately, they get replaced with the values that they have at that point in the file. So, in the documentation, instead of
template enforceEx(E) if (is(typeof(new E("", __FILE__, __LINE__))))
we get
template enforceEx(E) if (is(typeof(new E("", "std/exception.d", 524))))
which is likely to be confusing to folks. The compiler is smart enough to put __FILE__ and __LINE__ explicitly in the docs if they're default arguments, but not when they're inside a constraint. It wouldn't surprise me if the compiler substituted enums for their values if used in constraints as well (though I haven't verified that). But regardless of what is in the template constraint, I think that if they're going to be listed in the documentation, then they should be listed as they are in the source file and that nothing in them should be replaced with the values that they evaluate to when actually compiled.
Comment #1 by robert.schadek — 2024-12-13T18:21:41Z