diff --git a/source/common.h b/source/common.h index 2c822d49e..42174ae95 100644 --- a/source/common.h +++ b/source/common.h @@ -433,23 +433,6 @@ auto _as(auto x) } -// String path prefix from filename -// -auto strip_path(std::string const& file) - -> std::string -{ - auto i = std::ssize(file)-1; - while ( - i >= 0 - && file[i] != '\\' - && file[i] != '/' - ) - { - --i; - } - return {file, _as(i+1)}; -} - //----------------------------------------------------------------------- // diff --git a/source/to_cpp1.h b/source/to_cpp1.h index 9cc5b669d..bd50c091d 100644 --- a/source/to_cpp1.h +++ b/source/to_cpp1.h @@ -7191,7 +7191,10 @@ class cppfront || error != *prev ) { - error.print(std::cerr, strip_path(sourcefile)); + // The path as given, not just the file name, so an IDE can + // open the file even when cppfront runs in another folder + // (as build systems run it, in the output folder) + error.print(std::cerr, sourcefile); } prev = &error; }