46 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: cd %t4//5// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm6// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only7//8// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-reduced-module-interface -o %t/A.pcm9// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only10//11//--- foo.h12 13namespace ns {14struct A {};15 16template<typename Func>17constexpr bool __call_is_nt(A)18{19 return true;20}21ns::A make();22 23template <typename T>24bool foo(T t) {25 auto func = [](){};26 return __call_is_nt<decltype(func)>(t);27}28}29 30//--- A.cppm31module;32#include "foo.h"33export module A;34export namespace ns {35 using ns::foo;36 using ns::make;37}38 39//--- Use.cpp40// expected-no-diagnostics41import A;42void test() {43 auto a = ns::make();44 ns::foo(a);45}46