brintos

brintos / llvm-project-archived public Read only

0
0
Text · 836 B · 6614310 Raw
45 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 -fskip-odr-check-in-gmf %t/A.cppm -emit-module-interface -o %t/A.pcm6// RUN: %clang_cc1 -std=c++20 -fskip-odr-check-in-gmf %t/test.cpp -fprebuilt-module-path=%t -fsyntax-only -verify7 8//--- header.h9#pragma once10template <class _Tp>11class Optional {};12 13template <class _Tp>14concept C = requires(const _Tp& __t) {15    []<class _Up>(const Optional<_Up>&) {}(__t);16};17 18//--- func.h19#include "header.h"20template <C T>21void func() {}22 23//--- test_func.h24#include "func.h"25 26inline void test_func() {27    func<Optional<int>>();28}29 30//--- A.cppm31module;32#include "header.h"33#include "test_func.h"34export module A;35export using ::test_func;36 37//--- test.cpp38// expected-no-diagnostics39import A;40#include "test_func.h"41 42void test() {43    test_func();44}45