Bug 18322 – void fun(string file=__FILE_FULL_PATH__)() returns relative path (pointing to nowhere)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2018-01-28T08:03:13Z
Last change time
2021-01-03T22:57:16Z
Assigned to
No Owner
Creator
Timothee Cour

Comments

Comment #0 by timothee.cour2 — 2018-01-28T08:03:13Z
this is reminiscent of https://issues.dlang.org/show_bug.cgi?id=16640 but different, and in fact worse since it returns a wrong relative path dmd -Ifoo4 -run main.d foo4/main.d #BUG: relative path pointing to nowhere /path/to/main.d #OK: absolute path files: main.d foo4/util.d ``` // main.d: module main; import util; void main(){fun;} // foo4/main.d: module util; void fun(string file1=__FILE_FULL_PATH__)(string file2=__FILE_FULL_PATH__){ import std.stdio; writeln(file1); // BUG:relative path writeln(file2); // OK } ``` NOTE: calling it a regression because dmd 2.075 also returned a relative path instead of absolute (which is wrong) but at least the relative path it returned was correct instead of pointing to nowhere
Comment #1 by johnnymarler — 2018-01-28T12:11:25Z
Comment #2 by github-bugzilla — 2018-02-11T01:01:19Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1927521a0450c9904a9ed8bada1a2b5f9a506718 Fix issue 18322 https://github.com/dlang/dmd/commit/6a2db254e9f0185676713db481ee3780d65bea68 Merge pull request #7798 from marler8997/bug18322 Fix issue 18322: __FILE_FULL_PATH__ doesn't work as a template parameter merged-on-behalf-of: Mike Franklin <[email protected]>
Comment #3 by dlang-bot — 2021-01-03T22:57:16Z
dlang/dmd pull request #12093 "[dmd-cxx] Backport more recent traits to the C++ port" was merged into dmd-cxx: - 689820db99a7ce0d551d78639f2558c2d4d9cc95 by Jonathan Marler: [dmd-cxx] Fix issue 18322 https://github.com/dlang/dmd/pull/12093