This properly fixes the build break here.
/home/buildslave/slave_as-bldslv8/lld-perf-testsuite/llvm/include/llvm/Support/Error.h:1219:11: error: default arguments cannot be added to a function template that has already been declared * = nullptr) { ^ ~~~~~~~ /home/buildslave/slave_as-bldslv8/lld-perf-testsuite/llvm/include/llvm/Support/Error.h:1175:16: note: previous template declaration is here friend Error createFileError( ^ 1 error generated.
As an example, I've included a compile-time error in ErrorTest.cpp (which I would not commit), although I don't know how I should test this properly?
On a broader view, do you think shielding createFileError() against such usage is useful? It is a corner case, and it is already covered at runtime.
What if you just write:
Error createFileError(std::string F, ErrorSuccess) = delete;
Does that also solve the problem?