aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/instantiation-argdep-lookup.cppm
blob: 62dabfb6efddcfa40561cbe95855fa9ae71fda4f (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
38
39
40
41
42
43
44
45
// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: cd %t
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
//--- foo.h

namespace ns {
struct A {};

template<typename Func>
constexpr bool __call_is_nt(A)
{
    return true;
}
ns::A make();

template <typename T>
bool foo(T t) {
    auto func = [](){};
    return __call_is_nt<decltype(func)>(t);
}
}

//--- A.cppm
module;
#include "foo.h"
export module A;
export namespace ns {
    using ns::foo;
    using ns::make;
}

//--- Use.cpp
// expected-no-diagnostics
import A;
void test() {
    auto a = ns::make();
    ns::foo(a);
}