[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCXX / mangle-requires.cpp
blob9e2bdde03407a99c6c70bd61efc5fe6707565de6
1 // RUN: %clang_cc1 -verify -std=c++2a -fclang-abi-compat=latest -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
2 // expected-no-diagnostics
4 template <typename T, int N> concept SmallerThan = sizeof(T) < N;
5 template <typename T> concept Small = SmallerThan<T, 1000>;
7 template <typename T> struct X { using type = T; };
9 template <typename T> void f(int n) requires requires {
10 // simple-requirement
11 T();
13 n == T();
14 // compound-requirement
15 {T() + 1} -> Small;
16 {T() - 1} noexcept;
17 {T() * 2} noexcept -> SmallerThan<1234>;
18 // type-requirement
19 typename T;
20 typename X<T>;
21 typename X<T>::type;
22 typename X<decltype(n)>;
23 // nested-requirement
24 requires SmallerThan<T, 256>;
25 } {}
26 // CHECK: define {{.*}}@_Z1fIiEviQrqXcvT__EXfp_Xeqfp_cvS0__EXplcvS0__ELi1ER5SmallXmicvS0__ELi1ENXmlcvS0__ELi2ENR11SmallerThanILi1234EETS0_T1XIS0_ETNS3_4typeETS2_IiEQ11SmallerThanIS0_Li256EEE(
27 template void f<int>(int);
29 template <typename T> void g(int n) requires requires (T m) {
30 // reference to our parameter vs an enclosing parameter
31 n + m;
32 } {}
33 // CHECK: define {{.*}}@_Z1gIiEviQrQT__XplfL0p_fp_E(
34 template void g<int>(int);