diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-08-12 14:53:21 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-08-18 22:32:20 +0200 |
commit | 041f655c019788f375eec5db95d66e154b1e877b (patch) | |
tree | 54df381d2576a19aa8bc4b7c9440219b23122e66 /src/corelib/global | |
parent | 579a11590d72d88ebe76f6af6c8d13a098468525 (diff) |
Use [[nodiscard]] with clang in C++17 mode
It is only broken in C++11/c++14 mode.
We do need to fix the order of visibility-attributes and this
C++ attribute.
Change-Id: I41e4367f1aaa9241fec4e336c39e58b798336b2c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index df68d5acf7..a287bebc26 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1129,8 +1129,8 @@ # define Q_DECL_ALIGN(n) alignas(n) #endif -#if __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 +#if __has_cpp_attribute(nodiscard) && (!defined(Q_CC_CLANG) || __cplusplus > 201402L) // P0188R1 +// Can't use [[nodiscard]] with Clang and C++11/14, see https://bugs.llvm.org/show_bug.cgi?id=33518 # undef Q_REQUIRED_RESULT # define Q_REQUIRED_RESULT [[nodiscard]] #endif |