mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-27 13:57:52 +00:00
[AST] Assert that no type class is polymorphic
Add a static_assert checking that no type class is polymorphic. People should use LLVM style RTTI instead. Differential Revision: https://reviews.llvm.org/D55225 Reviewed By: aaron.ballman llvm-svn: 348281
This commit is contained in:
parent
660d233ea5
commit
32a728298c
@ -291,6 +291,14 @@ QualType QualType::getSingleStepDesugaredTypeImpl(QualType type,
|
||||
return Context.getQualifiedType(desugar, split.Quals);
|
||||
}
|
||||
|
||||
// Check that no type class is polymorphic. LLVM style RTTI should be used
|
||||
// instead. If absolutely needed an exception can still be added here by
|
||||
// defining the appropriate macro (but please don't do this).
|
||||
#define TYPE(CLASS, BASE) \
|
||||
static_assert(!std::is_polymorphic<CLASS##Type>::value, \
|
||||
#CLASS "Type should not be polymorphic!");
|
||||
#include "clang/AST/TypeNodes.def"
|
||||
|
||||
QualType Type::getLocallyUnqualifiedSingleStepDesugaredType() const {
|
||||
switch (getTypeClass()) {
|
||||
#define ABSTRACT_TYPE(Class, Parent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user