From f898fcfaef448bd3d8b6d28e6a0c9a1e69855428 Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Tue, 5 Oct 2021 14:12:28 -0700 Subject: [PATCH] $ is not a portable identifier character As per the C++14 spec, $ can't be used in a portable way in an identifier name. It falls under the implementation-defined characters and is allowed by clang. Removing it. --- lib/Sema/TypeCheckConcurrency.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index 31258def9874c..791834118f4eb 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -2873,12 +2873,13 @@ getActorIsolationForMainFuncDecl(FuncDecl *fnDecl) { ASTContext &ctx = fnDecl->getASTContext(); const bool isMainMain = fnDecl->isMainTypeMainMethod(); - const bool isMain$Main = + const bool isMainInternalMain = fnDecl->getBaseIdentifier() == ctx.getIdentifier("$main") && !fnDecl->isInstanceMember() && fnDecl->getResultInterfaceType()->isVoid() && fnDecl->getParameters()->size() == 0; - const bool isMainFunction = isMainDeclContext && (isMainMain || isMain$Main); + const bool isMainFunction = + isMainDeclContext && (isMainMain || isMainInternalMain); const bool hasMainActor = !ctx.getMainActorType().isNull(); return isMainFunction && hasMainActor