]> granicus.if.org Git - clang/commitdiff
[modules] Fix that global delete operator get's assigned to a submodule.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Fri, 9 Jun 2017 21:36:28 +0000 (21:36 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Fri, 9 Jun 2017 21:36:28 +0000 (21:36 +0000)
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

lib/Sema/SemaExprCXX.cpp

index 36a3a60ca1e186a73555cdba7d4df13ba923750d..34b10aec8807c2f2775f5f657d0bc17e927674de 100644 (file)
@@ -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(