mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
AK: Add SFINAE fallback for AK C++ concepts use, for Coverity compiler
The Coverity compiler doesn't support C++2a yet, and thus doesn't even recognize concept keywords. To allow serenity to be built and analyzed on such compilers, add a fallback underdef to perform the same template restriction based on AK::EnableIf<..> meta programming. Note: Coverity does seem to (annoyingly) define __cpp_concepts, even though it doesn't support them, so we need to further check for __COVERITY__ explicitly.
This commit is contained in:
parent
2030a49a1e
commit
ff0c7da75d
Notes:
sideshowbarker
2024-07-19 03:31:31 +09:00
Author: https://github.com/bgianfo
Commit: ff0c7da75d
Pull-request: https://github.com/SerenityOS/serenity/pull/3184
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
3 changed files with 17 additions and 3 deletions
|
@ -33,12 +33,12 @@ namespace AK {
|
|||
|
||||
// HACK: This is just here to make syntax highlighting work in Qt Creator.
|
||||
// Once it supports C++20 concepts, we can remove this.
|
||||
#ifdef __clang__
|
||||
template<typename T>
|
||||
#else
|
||||
#if defined(__cpp_concepts) && !defined(__COVERITY__)
|
||||
template<typename T>
|
||||
concept PointerTypeName = IsPointer<T>::value;
|
||||
template<PointerTypeName T>
|
||||
#else
|
||||
template<typename T, typename EnableIf<IsPointer<T>::value, int>::Type = 0>
|
||||
#endif
|
||||
|
||||
class Userspace {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue