brintos

brintos / llvm-project-archived public Read only

0
0
Text · 762 B · 202f8dd Raw
33 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-module-interface -o %t/B.pcm6// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify7 8// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -o %t/B.pcm9// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify10//11//--- templ.h12template <typename T, typename U = T>13class templ {};14template <typename T, typename U = void>15void templ_func() {}16 17//--- B.cppm18module;19#include "templ.h"20export module B;21export template <typename G>22templ<G> bar() {23  templ_func<G>();24  return {};25}26 27//--- Use.cpp28// expected-no-diagnostics29import B;30auto foo() {31  return bar<int>();32}33