[PATCH] D92573: [clang] Add a C++17 deduction guide testcase.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 3 04:52:15 PST 2020


hokein created this revision.
hokein added a reviewer: adamcz.
Herald added a project: clang.
hokein requested review of this revision.

>From https://bugs.llvm.org/show_bug.cgi?id=47219.

It was crashing before the commit 1e14588d0f68 <https://reviews.llvm.org/rG1e14588d0f6845976e774c87a18a84a0f7b61015>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92573

Files:
  clang/test/PCH/cxx17-deduction-guide-decl.cpp


Index: clang/test/PCH/cxx17-deduction-guide-decl.cpp
===================================================================
--- /dev/null
+++ clang/test/PCH/cxx17-deduction-guide-decl.cpp
@@ -0,0 +1,28 @@
+// 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) {}
+};
+
+// Class template argument deduction
+template <typename T>
+Some(T) -> Some<T>;
+
+struct Foo {};
+void ParseNatural() {
+  Some(Foo(), 1);
+}
+}
+
+#else
+
+#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92573.309230.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201203/f633c79e/attachment.bin>


More information about the cfe-commits mailing list