[clang] Add a C++17 deduction guide testcase.
authorHaojian Wu <hokein.wu@gmail.com>
Fri, 4 Dec 2020 08:02:04 +0000 (09:02 +0100)
committerHaojian Wu <hokein.wu@gmail.com>
Fri, 4 Dec 2020 08:02:50 +0000 (09:02 +0100)
From https://bugs.llvm.org/show_bug.cgi?id=47219.

It was crashing before the commit 1e14588d0f68.

Differential Revision: https://reviews.llvm.org/D92573

clang/test/PCH/cxx17-deduction-guide-decl.cpp [new file with mode: 0644]

diff --git a/clang/test/PCH/cxx17-deduction-guide-decl.cpp b/clang/test/PCH/cxx17-deduction-guide-decl.cpp
new file mode 100644 (file)
index 0000000..93ab82c
--- /dev/null
@@ -0,0 +1,24 @@
+// Test with pch.
+// RUN: %clang_cc1 -emit-pch -std=c++17  -o %t %s
+// RUN: %clang_cc1 -include-pch %t -emit-llvm -std=c++17 -o - %s
+
+#ifndef HEADER
+#define HEADER
+
+namespace RP47219 {
+typedef int MyInt;
+template <typename T>
+class Some {
+ public:
+  explicit Some(T, MyInt) {}
+};
+
+struct Foo {};
+void ParseNatural() {
+  Some(Foo(), 1);
+}
+}
+
+#else
+
+#endif