diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-07-21 10:22:01 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-07-26 22:25:42 +0000 |
commit | be93d2de031fb870a1ff244304311e07536a13b9 (patch) | |
tree | 89999ddd7f4859ac646a209fecc867f6658a8682 /src/corelib | |
parent | 50275fbcaf60ed41bd4486f8239cc7914c8af0f5 (diff) |
Blacklist use of [[nodiscard]] with Clang
__has_cpp_attribute(nodiscard) is 1 in all compilation modes, but if you
use it outside of C++1z, you get a warning.
LLVM-bug: https://bugs.llvm.org/show_bug.cgi?id=33518
Task-number: QTBUG-61840
Task-number: QTBUG-62085
Change-Id: I84e45059a888497fb55ffffd14d3683f4808978b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 05e3f6c45a..2c58ff87e9 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1172,7 +1172,8 @@ # define Q_DECL_ALIGN(n) alignas(n) #endif -#if QT_HAS_CPP_ATTRIBUTE(nodiscard) // P0188R1 +#if QT_HAS_CPP_ATTRIBUTE(nodiscard) && !defined(Q_CC_CLANG) // P0188R1 +// Can't use [[nodiscard]] with Clang, see https://bugs.llvm.org/show_bug.cgi?id=33518 # undef Q_REQUIRED_RESULT # define Q_REQUIRED_RESULT [[nodiscard]] #endif |