summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/friend-template.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/PCH/friend-template.cpp')
-rw-r--r--clang/test/PCH/friend-template.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/clang/test/PCH/friend-template.cpp b/clang/test/PCH/friend-template.cpp
new file mode 100644
index 00000000000..989819b64fb
--- /dev/null
+++ b/clang/test/PCH/friend-template.cpp
@@ -0,0 +1,46 @@
+// Test this without pch.
+// RUN: %clang_cc1 -include %s -fsyntax-only -verify %s
+
+// Test with pch.
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+// rdar://12627738
+namespace rdar12627738 {
+
+class RecyclerTag {
+ template <typename T> friend class Recycler;
+};
+
+}
+
+#else
+
+namespace rdar12627738 {
+
+template<typename TTag>
+class CRN {
+ template <typename T> friend class Recycler;
+};
+
+
+template<typename T>
+class Recycler {
+public:
+ Recycler ();
+};
+
+
+template<typename T>
+Recycler<T>::Recycler ()
+{
+}
+
+}
+
+#endif
OpenPOWER on IntegriCloud