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();
}
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();
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits