[modules] Add a regression test for PR21547.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Wed, 30 Mar 2016 20:10:07 +0000 (20:10 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Wed, 30 Mar 2016 20:10:07 +0000 (20:10 +0000)
llvm-svn: 264908

clang/test/Modules/Inputs/PR21547/FirstHeader.h [new file with mode: 0644]
clang/test/Modules/Inputs/PR21547/module.modulemap [new file with mode: 0644]
clang/test/Modules/pr21547.cpp [new file with mode: 0644]

diff --git a/clang/test/Modules/Inputs/PR21547/FirstHeader.h b/clang/test/Modules/Inputs/PR21547/FirstHeader.h
new file mode 100644 (file)
index 0000000..a01c607
--- /dev/null
@@ -0,0 +1,13 @@
+template<class Element> struct TMatrixT;
+typedef TMatrixT<double> TMatrixD;
+
+void f(const TMatrixD &m);
+
+template<class Element> struct TMatrixT {
+  template <class Element2> TMatrixT(const TMatrixT<Element2> &);
+  ~TMatrixT() {}
+  void Determinant () { f(*this); }
+};
+
+template struct TMatrixT<float>;
+template struct TMatrixT<double>;
diff --git a/clang/test/Modules/Inputs/PR21547/module.modulemap b/clang/test/Modules/Inputs/PR21547/module.modulemap
new file mode 100644 (file)
index 0000000..8ca0643
--- /dev/null
@@ -0,0 +1,4 @@
+module M {
+  header "FirstHeader.h"
+  export *
+}
diff --git a/clang/test/Modules/pr21547.cpp b/clang/test/Modules/pr21547.cpp
new file mode 100644 (file)
index 0000000..db3b6dd
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -I%S/Inputs/PR21547 -verify %s
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/PR21547 -verify %s
+
+#include "Inputs/PR21547/FirstHeader.h"
+
+//expected-no-diagnostics