diff --git a/clang/include/clang/Sema/SemaCheerp.h b/clang/include/clang/Sema/SemaCheerp.h index 15733e6640f1..ae6f5e51c696 100644 --- a/clang/include/clang/Sema/SemaCheerp.h +++ b/clang/include/clang/Sema/SemaCheerp.h @@ -24,7 +24,7 @@ namespace cheerp{ enum class TypeKind { - Void, Boolean, IntLess32Bit, UnsignedInt32Bit, SignedInt32Bit, IntGreater32Bit, FloatingPoint, NamespaceClient, Pointer, Function, FunctionPointer, Reference, JsExportable, Other, Impossible, + Void, Boolean, IntLess32Bit, UnsignedInt32Bit, SignedInt32Bit, IntGreater32Bit, FloatingPoint, NamespaceClient, Pointer, Function, FunctionPointer, Reference, JsExportable, Other, Impossible, NullPtr, }; enum class SpecialFunctionClassify diff --git a/clang/lib/Sema/SemaCheerp.cpp b/clang/lib/Sema/SemaCheerp.cpp index 06d61b650481..7e57bf1653f3 100644 --- a/clang/lib/Sema/SemaCheerp.cpp +++ b/clang/lib/Sema/SemaCheerp.cpp @@ -196,6 +196,7 @@ void cheerp::TypeChecker::checkTypeImpl(const clang::QualType& Ty, clang::Source case TypeKind::UnsignedInt32Bit: case TypeKind::SignedInt32Bit: case TypeKind::FloatingPoint: + case TypeKind::NullPtr: { //Good! return; @@ -335,6 +336,10 @@ cheerp::TypeKind cheerp::TypeChecker::classifyType(const clang::QualType& Qy, co { return TypeKind::Pointer; } + if (Ty->isNullPtrType()) + { + return TypeKind::NullPtr; + } const clang::CXXRecordDecl* Record = Ty->getAsCXXRecordDecl(); if (Record == NULL)