Skip to content

Commit 3fcf385

Browse files
committed
improved compilation error message for return errors
1 parent f83bb4f commit 3fcf385

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

trompeloeil.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,10 +922,9 @@ namespace trompeloeil
922922
static_assert(std::is_constructible<return_of_t<signature>, ret>::value
923923
|| std::is_same<return_of_t<signature>, void>::value,
924924
"RETURN value is not convertible to the return type of the function");
925-
static_assert(!std::is_same<return_type, ret>::value
926-
|| std::is_same<return_type, void>::value,
925+
static_assert(std::is_same<return_type, void>::value,
927926
"Multiple RETURN does not make sense");
928-
static_assert(!throws,
927+
static_assert(!throws || upper_call_limit == 0,
929928
"THROW and RETURN does not make sense");
930929
static_assert(upper_call_limit > 0ULL,
931930
"RETURN for forbidden call does not make sense");

0 commit comments

Comments
 (0)