Do not #define keywords.

This commit is contained in:
Axel Naumann 2016-08-25 15:01:16 +02:00 committed by sftnight
parent 52839d827f
commit ec7c96a324
2 changed files with 17 additions and 9 deletions

View File

@ -12,8 +12,12 @@
#include <exception>
#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(noexcept)
#define noexcept
#ifndef CLING_NOEXCEPT
# if defined(_MSC_VER) && (_MSC_VER < 1900)
# define CLING_NOEXCEPT
# else
# define CLING_NOEXCEPT noexcept
# endif
#endif
namespace clang {
@ -27,9 +31,9 @@ namespace cling {
///
class InterpreterException : public std::exception {
public:
virtual ~InterpreterException() noexcept;
virtual ~InterpreterException() CLING_NOEXCEPT;
virtual const char* what() const noexcept;
virtual const char* what() const CLING_NOEXCEPT;
virtual void diagnose() const {}
};
@ -46,9 +50,9 @@ namespace cling {
DerefType m_Type;
public:
InvalidDerefException(clang::Sema* S, clang::Expr* E, DerefType type);
virtual ~InvalidDerefException() noexcept;
virtual ~InvalidDerefException() CLING_NOEXCEPT;
const char* what() const noexcept override;
const char* what() const CLING_NOEXCEPT override;
void diagnose() const override;
};
} // end namespace cling

View File

@ -14,8 +14,12 @@
#include "clang/AST/DeclVisitor.h"
#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(constexpr)
#define constexpr const
#ifndef CLING_CONSTEXPR
# if defined(_MSC_VER) && (_MSC_VER < 1900)
# define CLING_CONSTEXPR const
# else
# define CLING_CONSTEXPR constexpr
# endif
#endif
namespace clang {
@ -256,7 +260,7 @@ namespace clang {
///
void CollectFilesToUncache(SourceLocation Loc);
constexpr static bool isDefinition(void*) { return false; }
CLING_CONSTEXPR static bool isDefinition(void*) { return false; }
static bool isDefinition(TagDecl* R);
static void resetDefinitionData(void*) {