Skip to content

Commit 671576d

Browse files
committed
Basic: silence MSVC pedantic warning (NFC)
The constructor here required multiple user-defined conversions which is not exactly pedantically correct. Add an explicit indicator that the constructor being invoked is the `StringRef` constructor to convert the `SmallString` to a `StringRef` which can then be implicitly converted to the `Optional<StringRef>`. This silences a MSVC warning (clang should catch this with `-pedantic`).
1 parent c9bdd3a commit 671576d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Basic/Default/Task.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ bool Task::execute() {
8484
}
8585

8686
Optional<StringRef> Redirects[] = {
87-
None, {StdoutPath}, {SeparateErrors ? StderrPath : StdoutPath}};
87+
None,
88+
StringRef{StdoutPath},
89+
StringRef{SeparateErrors ? StderrPath : StdoutPath},
90+
};
8891

8992
bool ExecutionFailed = false;
9093
PI = llvm::sys::ExecuteNoWait(ExecPath, llvm::toStringRefArray(Argv.data()),

0 commit comments

Comments
 (0)