From 89a2a11d9f39f60097619212d3fed9ab8c216c8b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 19 Jan 2018 14:58:26 +0100 Subject: Don't use [[noreturn]] --- src/libexpr/eval.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index f8685e010..33a9bc614 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -337,10 +337,6 @@ Path EvalState::checkSourcePath(const Path & path_) { if (!allowedPaths) return path_; - auto doThrow = [&]() [[noreturn]] { - throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path_); - }; - bool found = false; for (auto & i : *allowedPaths) { @@ -350,7 +346,8 @@ Path EvalState::checkSourcePath(const Path & path_) } } - if (!found) doThrow(); + if (!found) + throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path_); /* Resolve symlinks. */ debug(format("checking access to '%s'") % path_); @@ -361,7 +358,7 @@ Path EvalState::checkSourcePath(const Path & path_) return path; } - doThrow(); + throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path); } -- cgit v1.2.3