logging: fix issues detecting XLOG(FATAL) statements as noreturn
authorAdam Simpkins <simpkins@fb.com>
Thu, 22 Jun 2017 18:44:38 +0000 (11:44 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 22 Jun 2017 18:50:40 +0000 (11:50 -0700)
commit61a0ef5508c64a7e05c574b5314a78a07d2f88dd
tree10106f97ad22bcdca8009fcc78f14d6b453e241f
parent38ba47c32ffd3416865420c0d505b1a1360a6684
logging: fix issues detecting XLOG(FATAL) statements as noreturn

Summary:
Update the FB_LOG() and XLOG() macros so that FATAL log messages are correctly
detected as not returning, by both clang and gcc.

We have to ensure that both sides of the log statement check (log message
enabled or disabled) evaluate to `[[noreturn]]` expressions.  I did try
updating the log check itself so that it could be constexpr detected as always
passing, but this was not sufficient.

Reviewed By: wez

Differential Revision: D5290780

fbshipit-source-id: 773a56a8392dfd7c310d5d84fc9311e66edf99cb
folly/experimental/logging/LogCategory.cpp
folly/experimental/logging/LogStreamProcessor.cpp
folly/experimental/logging/LogStreamProcessor.h
folly/experimental/logging/Logger.h
folly/experimental/logging/test/FatalHelper.cpp
folly/experimental/logging/xlog.h