From b1b5ee737ba9b655885bf322ff94d268b46a7a1d Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Sat, 25 May 2024 22:05:31 +0200 Subject: [PATCH] Fix functional for no parameters --- include/opp/functional.h | 5 +++++ oscar64/Declaration.cpp | 2 +- oscar64/Parser.cpp | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/opp/functional.h b/include/opp/functional.h index d0c4ddf..f9aef0b 100644 --- a/include/opp/functional.h +++ b/include/opp/functional.h @@ -51,6 +51,11 @@ public: f.c = nullptr; } + function(void) + { + c = nullptr; + } + function & operator=(const function & f) { if (c != f.c) diff --git a/oscar64/Declaration.cpp b/oscar64/Declaration.cpp index 7cff5d9..c0ef334 100644 --- a/oscar64/Declaration.cpp +++ b/oscar64/Declaration.cpp @@ -1715,7 +1715,7 @@ bool Declaration::ResolveTemplate(Declaration* fdec, Declaration* tdec) { if (tpdec->mBase->mType == DT_PACK_TEMPLATE) { - if (fpdec->mBase->mType == DT_PACK_TEMPLATE) + if (fpdec && fpdec->mBase->mType == DT_PACK_TEMPLATE) mScope->Insert(tdec->mIdent, fpdec); else { diff --git a/oscar64/Parser.cpp b/oscar64/Parser.cpp index 53e3fd2..49cc3c7 100644 --- a/oscar64/Parser.cpp +++ b/oscar64/Parser.cpp @@ -6104,7 +6104,6 @@ int Parser::OverloadDistance(Declaration* fdec, Expression* pexp) { if (pexp->mRight && pexp->mRight->mDecType->IsConstSame(fdec->mBase->mParams->mBase->mBase)) return NOOVERLOAD; - printf("oopsie"); } }