aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/InheritDefaultArguments.cppm
blob: 0ef6390204c4b9fad3ace04c4b38e5a39fbbc358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// 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

// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-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 {
public:
    Templ(T t) {}
};

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;
void foo() {
    Templ t(0);
}