[NFC] [Modules] Add test for inherit default arguments
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 30 Jun 2022 07:48:22 +0000 (15:48 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 30 Jun 2022 07:48:22 +0000 (15:48 +0800)
clang/test/Modules/InheritDefaultArguments.cppm [new file with mode: 0644]

diff --git a/clang/test/Modules/InheritDefaultArguments.cppm b/clang/test/Modules/InheritDefaultArguments.cppm
new file mode 100644 (file)
index 0000000..bbd5ad4
--- /dev/null
@@ -0,0 +1,28 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: cd %t
+//
+// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
+// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cppm -verify -fsyntax-only
+
+//--- foo.h
+template <typename T, typename U = int>
+class Templ;
+
+template <typename T, typename U>
+class Templ {};
+
+template <typename T>
+Templ(T t) -> Templ<T, int>;
+
+//--- A.cppm
+module;
+#include "foo.h"
+export module A;
+
+//--- Use.cppm
+// expected-no-diagnostics
+module;
+#include "foo.h"
+export module X;
+import A;