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