Skip to content

Commit 8a6ace1

Browse files
committed
MSVC noexcept(X) workaround
1 parent 4216da0 commit 8a6ace1

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

llvm/include/llvm/Support/IOSandbox.h

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,42 @@ namespace llvm::sys::sandbox {
5454
/// }
5555
template <class FnTy> struct Interposed;
5656

57-
template <class RetTy, class... ArgTy, bool NE>
58-
struct Interposed<RetTy (*)(ArgTy...) noexcept(NE)> {
57+
template <class RetTy, class... ArgTy> struct Interposed<RetTy (*)(ArgTy...)> {
5958
RetTy (*Fn)(ArgTy...);
6059

61-
RetTy operator()(ArgTy... Arg) const noexcept(NE) {
60+
RetTy operator()(ArgTy... Arg) const {
6261
violationIfEnabled();
6362
return Fn(std::forward<ArgTy>(Arg)...);
6463
}
6564
};
6665

67-
template <class RetTy, class... ArgTy, bool NE>
68-
struct Interposed<RetTy (*)(ArgTy..., ...) noexcept(NE)> {
66+
template <class RetTy, class... ArgTy>
67+
struct Interposed<RetTy (*)(ArgTy...) noexcept> {
68+
RetTy (*Fn)(ArgTy...) noexcept;
69+
70+
RetTy operator()(ArgTy... Arg) const noexcept {
71+
violationIfEnabled();
72+
return Fn(std::forward<ArgTy>(Arg)...);
73+
}
74+
};
75+
76+
template <class RetTy, class... ArgTy>
77+
struct Interposed<RetTy (*)(ArgTy..., ...)> {
6978
RetTy (*Fn)(ArgTy..., ...);
7079

7180
template <class... CVarArgTy>
72-
RetTy operator()(ArgTy... Arg, CVarArgTy... CVarArg) const noexcept(NE) {
81+
RetTy operator()(ArgTy... Arg, CVarArgTy... CVarArg) const {
82+
violationIfEnabled();
83+
return Fn(std::forward<ArgTy>(Arg)..., std::forward<CVarArgTy>(CVarArg)...);
84+
}
85+
};
86+
87+
template <class RetTy, class... ArgTy>
88+
struct Interposed<RetTy (*)(ArgTy..., ...) noexcept> {
89+
RetTy (*Fn)(ArgTy..., ...) noexcept;
90+
91+
template <class... CVarArgTy>
92+
RetTy operator()(ArgTy... Arg, CVarArgTy... CVarArg) const noexcept {
7393
violationIfEnabled();
7494
return Fn(std::forward<ArgTy>(Arg)..., std::forward<CVarArgTy>(CVarArg)...);
7595
}

0 commit comments

Comments
 (0)