1 // RUN: %clang_cc1 -std=c++20 %s -triple x86_64-linux-gnu -emit-llvm -o - | FileCheck %s
3 struct ThisShouldBeCalled
{
4 ThisShouldBeCalled() {}
8 struct ThisShouldBeCalledTPL
{
9 ThisShouldBeCalledTPL() {}
16 struct WithConsteval
{
17 WithConsteval(int x
= f()) {}
21 struct WithConstevalTPL
{
22 WithConstevalTPL(T x
= f()) {}
27 ThisShouldBeCalled y
= {};
31 ThisShouldBeCalledTPL
<int> A
= {};
33 WithConstevalTPL
<double> C
= {};
41 // CHECK-LABEL: @_ZN18ThisShouldBeCalledC2Ev
42 // CHECK-LABEL: @_ZN21ThisShouldBeCalledTPLIiEC2Ev
43 // CHECK-LABEL: @_ZN13WithConstevalC2Ei
44 // CHECK-LABEL: @_ZN16WithConstevalTPLIdEC2Ed
46 namespace check_arrays
{
66 // CHECK-LABEL: @_ZN12check_arrays5innerIiEC2Ev
70 namespace check_field_inits_in_base_constructors
{
73 struct ShouldBeODRUsed
{
77 // The private here is important,
78 // otherwise it would be aggregate initialized.
80 ShouldBeODRUsed
<k
> a
= {};
88 // CHECK-LABEL: @_ZN38check_field_inits_in_base_constructors15ShouldBeODRUsedINS_1kEEC2Ev
92 namespace check_referenced_when_defined_in_default_parameter
{
100 Test
<bool(bool x
)> identity
= [](bool x
) -> bool { return x
; };
104 Wrapper(const Options
& options
= Options());
107 void Func() { Options options
; }
109 // CHECK-LABEL: @_ZN50check_referenced_when_defined_in_default_parameter7OptionsC2Ev
110 // CHECK-LABEL: @_ZN50check_referenced_when_defined_in_default_parameter4TestIFbbEEC1INS_7Options8identityMUlbE_EEEOT_
111 // CHECK-LABEL: @_ZN50check_referenced_when_defined_in_default_parameter4TestIFbbEEC2INS_7Options8identityMUlbE_EEEOT_
115 namespace lambda_body
{
116 template <typename a
>
117 int templated_func() {
121 int mem
= templated_func
<int>();
123 struct test_capture
{
124 int mem
= templated_func
<double>();
128 int a
= [_
= test_capture
{}] { (void)test_body
{}; return 0;}();
135 // CHECK-LABEL: define{{.*}} @_ZN11lambda_body14templated_funcIdEEiv
136 // CHECK-LABEL: define{{.*}} @_ZNK11lambda_body1S1aMUlvE_clEv
137 // CHECK-LABEL: define{{.*}} @_ZN11lambda_body14templated_funcIiEEiv