Skip to content

Commit

Permalink
Allow std::nullptr_t in client functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DutChen18 committed Dec 27, 2023
1 parent 6d8dea9 commit 5952fec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/include/clang/Sema/SemaCheerp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions clang/lib/Sema/SemaCheerp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5952fec

Please sign in to comment.