xref: /llvm-project/clang/test/Modules/hashing-decls-in-exprs-from-gmf-2.cppm (revision d26dd58ca5b59032eb371b8f51d9134acdd8d3ad)
1// RUN: rm -rf %t
2// RUN: mkdir -p %t
3// RUN: split-file %s %t
4//
5// RUN: %clang_cc1 -std=c++20 -fskip-odr-check-in-gmf %t/A.cppm -emit-module-interface -o %t/A.pcm
6// RUN: %clang_cc1 -std=c++20 -fskip-odr-check-in-gmf %t/test.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
7
8//--- header.h
9#pragma once
10template <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.h
19#include "header.h"
20template <C T>
21void func() {}
22
23//--- test_func.h
24#include "func.h"
25
26inline void test_func() {
27    func<Optional<int>>();
28}
29
30//--- A.cppm
31module;
32#include "header.h"
33#include "test_func.h"
34export module A;
35export using ::test_func;
36
37//--- test.cpp
38// expected-no-diagnostics
39import A;
40#include "test_func.h"
41
42void test() {
43    test_func();
44}
45