From: Vassil Vassilev Date: Fri, 9 Jun 2017 21:36:28 +0000 (+0000) Subject: [modules] Fix that global delete operator get's assigned to a submodule. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75cf4f5e8b0c3fc3147d3bf29e0cb98d535ea635;p=clang [modules] Fix that global delete operator get's assigned to a submodule. n the current local-submodule-visibility mode, as soon as we discover a virtual destructor, we declare on demand a global delete operator. However, this causes that this delete operator is owned by the submodule which contains said virtual destructor. This means that other modules no longer can see the global delete operator which is hidden inside another submodule and fail to compile. This patch unhides those global allocation function once they're created to prevent this issue. Patch by Raphael Isemann (D33366)! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305118 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 36a3a60ca1..34b10aec88 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -2658,6 +2658,8 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, Context, GlobalCtx, SourceLocation(), SourceLocation(), Name, FnType, /*TInfo=*/nullptr, SC_None, false, true); Alloc->setImplicit(); + // Global allocation functions should always be visible. + Alloc->setHidden(false); // Implicit sized deallocation functions always have default visibility. Alloc->addAttr(