Skip to content

Commit 429a84f

Browse files
committed
[clang] Fix ambiguity in runOnNewStack
1 parent d0c973a commit 429a84f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/include/llvm/Support/ProgramStack.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ unsigned getDefaultStackSize();
4545
void runOnNewStack(unsigned StackSize, function_ref<void()> Fn);
4646

4747
template <typename R, typename... Ts>
48-
R runOnNewStack(unsigned StackSize, function_ref<R(Ts...)> Fn, Ts &&...Args) {
48+
std::enable_if_t<!std::is_same_v<R, void>, R>
49+
runOnNewStack(unsigned StackSize, function_ref<R(Ts...)> Fn, Ts &&...Args) {
4950
std::optional<R> Ret;
5051
runOnNewStack(StackSize, [&]() { Ret = Fn(std::forward<Ts>(Args)...); });
5152
return std::move(*Ret);

0 commit comments

Comments
 (0)