Mark FormatArg::error as noreturn
authorChristopher Dykes <cdykes@fb.com>
Wed, 10 Aug 2016 20:18:10 +0000 (13:18 -0700)
committerFacebook Github Bot 0 <facebook-github-bot-0-bot@fb.com>
Wed, 10 Aug 2016 20:23:31 +0000 (13:23 -0700)
Summary: Because, if no inlining is enabled, the absence of this attribute caused compile errors due to functions that were expected to return a value not returning a value.

Reviewed By: meyering

Differential Revision: D3698413

fbshipit-source-id: 8f3505b17a2fa7b9710e3fb56d18c6ca00feacb3

folly/FormatArg.h

index 6f25299e5217c647825452a1661386f08aa0e8ab..701654b3397453a8a59e7c924c0a6ff08ff858dc 100644 (file)
@@ -211,7 +211,7 @@ inline std::string FormatArg::errorStr(Args&&... args) const {
 }
 
 template <typename... Args>
-inline void FormatArg::error(Args&&... args) const {
+[[noreturn]] inline void FormatArg::error(Args&&... args) const {
   throw BadFormatArg(errorStr(std::forward<Args>(args)...));
 }