Compiler detection: guard =delete("reason") on Clang
Clang advertises support for =delete("reason") even in pre-C++26 language modes, however it also emits a warning if one uses it (because it considers the feature a language extension). I claim it's a Clang bug [1], as SD6 doesn't require language version checks and this specific feature is useful in all language modes, so if an implementation decides to offer it it shouldn't also warn about it being an extension. In any case, this commit works around the issue by disabling the feature on pre-C++26 modes. C++26 doesn't have a __cplusplus macro to use, so I'm just taking > C++23. [1] https://github.com/llvm/llvm-project/issues/109311 Change-Id: If1970acb8f7df23c765ab5da747cb59b7b7a6dc7 Pick-to: 6.8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
439e19be17
commit
d9d4d15aef
@ -1024,7 +1024,11 @@
|
||||
#endif
|
||||
|
||||
#ifndef Q_DECL_EQ_DELETE_X
|
||||
# if defined(__cpp_deleted_function) && __cpp_deleted_function >= 202403L
|
||||
// Clang advertises the feature-testing macro but issues a warning
|
||||
// if one isn't also using C++26,
|
||||
// https://github.com/llvm/llvm-project/issues/109311
|
||||
# if defined(__cpp_deleted_function) && __cpp_deleted_function >= 202403L \
|
||||
&& (!defined(Q_CC_CLANG_ONLY) || __cplusplus > 202302L) // C++26
|
||||
# define Q_DECL_EQ_DELETE_X(reason) = delete(reason)
|
||||
# else
|
||||
# define Q_DECL_EQ_DELETE_X(reason) = delete
|
||||
|
Loading…
x
Reference in New Issue
Block a user