https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118951
Bug ID: 118951 Summary: __FILE__ inserts the filename as array, __builtin_FILE as pointer Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fabian_kessler at gmx dot de Target Milestone: --- __builtin_FILE should return the FILE_PATH as array, not as pointer. This wouldn't have any drawbacks, since an array can be decayed as a pointer, but it is currently not possible, to do it the other way round for 0-terminated strings. Returning __builtin_FILE as array will allow code like the following: ``` template <class T, auto File = __builtin_FILE(), auto Line = __builtin_line()> struct strong_alias<>{/*...*/}; ``` In the current situation, it is only possible, to do this via macros. Also add __builtin_FILE_NAME, which is supported by clang.