Debian Codegraph @

clang/test/Modules/deduction-guide.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: split-file %s %t
4 //
5 // RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-module-interface -o %t/Templ.pcm
6 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
7
8 // RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-reduced-module-interface -o %t/Templ.pcm
9 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
10
11 //--- foo.h
12 template <typename T>
13 class Templ {
14 public:
15 Templ(T a) {}
16 };
17
18 template<typename T>
19 Templ(T t) -> Templ<T>;
20
21 //--- Templ.cppm
22 module;
23 #include "foo.h"
24 export module Templ;
25 export using ::Templ;
26
27 //--- Use.cpp
28 // expected-no-diagnostics
29 import Templ;
30 void func() {
31 Templ t(5);
32 }
33