[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:37:46 PDT 2016


EricWF updated this revision to Diff 76384.
EricWF added a comment.

Add test case.


https://reviews.llvm.org/D26143

Files:
  lib/Sema/SemaDeclCXX.cpp
  test/Modules/Inputs/merge-decl-context/a.h


Index: test/Modules/Inputs/merge-decl-context/a.h
===================================================================
--- test/Modules/Inputs/merge-decl-context/a.h
+++ test/Modules/Inputs/merge-decl-context/a.h
@@ -24,5 +24,6 @@
 struct Aggregate {
   int member;
 };
+bool operator==(Aggregate, Aggregate) = delete;
 
 #endif
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.76384.patch
Type: text/x-patch
Size: 817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161031/88afc6b6/attachment.bin>


More information about the cfe-commits mailing list