-
-
Notifications
You must be signed in to change notification settings - Fork 245
/
ClangCompat.h
34 lines (26 loc) · 1.25 KB
/
ClangCompat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/******************************************************************************
*
* C++ Insights, copyright (C) by Andreas Fertig
* Distributed under an MIT license. See LICENSE for details
*
****************************************************************************/
#ifndef INSIGHTS_CLANG_COMPAT_H
#define INSIGHTS_CLANG_COMPAT_H
//-----------------------------------------------------------------------------
#include <clang/Basic/Version.h>
#include "version.h"
//-----------------------------------------------------------------------------
#define IS_CLANG_NEWER_THAN(major) (CLANG_VERSION_MAJOR > (major))
//-----------------------------------------------------------------------------
namespace clang::insights {
template<unsigned int MAJOR>
struct IsClangNewerThan
{
static_assert(INSIGHTS_MIN_LLVM_MAJOR_VERSION < MAJOR, "Remove this function, all clang versions support it now");
constexpr static inline bool value{CLANG_VERSION_MAJOR > MAJOR};
};
//-----------------------------------------------------------------------------
// inline constexpr bool IsClangNewerThan8 = IsClangNewerThan<8>::value;
//-----------------------------------------------------------------------------
} // namespace clang::insights
#endif /* INSIGHTS_CLANG_COMPAT_H */