This revision was automatically updated to reflect the committed changes.
Closed by commit rG99b54743106b: [Modules] Add test for merging of template 
member parent (authored by Hahnfeld).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156806/new/

https://reviews.llvm.org/D156806

Files:
  clang/test/Modules/merge-template-members-parent.cpp


Index: clang/test/Modules/merge-template-members-parent.cpp
===================================================================
--- /dev/null
+++ clang/test/Modules/merge-template-members-parent.cpp
@@ -0,0 +1,64 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: split-file %s %t
+
+// RUN: %clang_cc1 -emit-obj -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t %t/merge.cpp -o %t/merge.o
+
+//--- V.h
+#ifndef V_H
+#define V_H
+template <typename T>
+struct V {
+  ~V() {}
+};
+#endif
+
+//--- A.h
+#include "V.h"
+
+void A(const V<unsigned long> &v);
+
+//--- B.h
+#include "V.h"
+
+inline V<unsigned long> B() {
+  return {};
+}
+
+//--- C.h
+#include "V.h"
+
+#include "A.h"
+
+class C {
+public:
+  C(const V<unsigned long> &v) {
+    V<unsigned long> v2;
+  }
+};
+
+C GetC() {
+   return {{}};
+}
+
+// This include *MUST* come last.
+#include "B.h"
+
+//--- module.modulemap
+module "V" { header "V.h" export * }
+module "A" { header "A.h" export * }
+module "B" { header "B.h" export * }
+module "C" { header "C.h" export * }
+
+//--- merge.cpp
+#include "C.h"
+
+template <typename T>
+C GetC_main() {
+   return {{}};
+}
+
+void f() {
+   GetC_main<float>();
+   GetC();
+}


Index: clang/test/Modules/merge-template-members-parent.cpp
===================================================================
--- /dev/null
+++ clang/test/Modules/merge-template-members-parent.cpp
@@ -0,0 +1,64 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: split-file %s %t
+
+// RUN: %clang_cc1 -emit-obj -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %t/merge.cpp -o %t/merge.o
+
+//--- V.h
+#ifndef V_H
+#define V_H
+template <typename T>
+struct V {
+  ~V() {}
+};
+#endif
+
+//--- A.h
+#include "V.h"
+
+void A(const V<unsigned long> &v);
+
+//--- B.h
+#include "V.h"
+
+inline V<unsigned long> B() {
+  return {};
+}
+
+//--- C.h
+#include "V.h"
+
+#include "A.h"
+
+class C {
+public:
+  C(const V<unsigned long> &v) {
+    V<unsigned long> v2;
+  }
+};
+
+C GetC() {
+   return {{}};
+}
+
+// This include *MUST* come last.
+#include "B.h"
+
+//--- module.modulemap
+module "V" { header "V.h" export * }
+module "A" { header "A.h" export * }
+module "B" { header "B.h" export * }
+module "C" { header "C.h" export * }
+
+//--- merge.cpp
+#include "C.h"
+
+template <typename T>
+C GetC_main() {
+   return {{}};
+}
+
+void f() {
+   GetC_main<float>();
+   GetC();
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D156806: ... Jonas Hahnfeld via Phabricator via cfe-commits
    • [PATCH] D156... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D156... Chuanqi Xu via Phabricator via cfe-commits
    • [PATCH] D156... Jonas Hahnfeld via Phabricator via cfe-commits

Reply via email to