[PATCH] D26143: [modules] Mark deleted functions as implicitly inline to allow merging

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 04:36:56 PDT 2016


EricWF created this revision.
EricWF added reviewers: rsmith, silvas, manmanren.
EricWF added a subscriber: cfe-commits.

When merging definitions with ModulesLocalVisibility enabled it's important to make deleted definitions implicitly inline, otherwise they'll be diagnosed as a redefinition.


https://reviews.llvm.org/D26143

Files:
  lib/Sema/SemaDeclCXX.cpp


Index: lib/Sema/SemaDeclCXX.cpp
===================================================================
--- lib/Sema/SemaDeclCXX.cpp
+++ lib/Sema/SemaDeclCXX.cpp
@@ -13870,6 +13870,11 @@
   if (Fn->isMain())
     Diag(DelLoc, diag::err_deleted_main);
 
+  // C++11 [dcl.fct.def.delete]p4:
+  //  A deleted function is implicitly inline.
+  // NOTE: Modules cannot correctly merge deleted functions unless they are
+  // inline.
+  Fn->setImplicitlyInline();
   Fn->setDeletedAsWritten();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26143.76382.patch
Type: text/x-patch
Size: 489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161031/c75f7f10/attachment.bin>


More information about the cfe-commits mailing list