1 // Tests that we can merge the concept declarations with lambda well.
5 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
8 // RUN: %clang_cc1 -std=c++20 %t/A0.cppm -emit-module-interface -o %t/A0.pcm
9 // RUN: %clang_cc1 -std=c++20 %t/TestA.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
11 // RUN: %clang_cc1 -std=c++20 %t/A1.cppm -emit-module-interface -o %t/A1.pcm
12 // RUN: %clang_cc1 -std=c++20 %t/TestA1.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
14 // RUN: %clang_cc1 -std=c++20 %t/A2.cppm -emit-module-interface -o %t/A2.pcm
15 // RUN: %clang_cc1 -std=c++20 %t/TestA2.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
17 // RUN: %clang_cc1 -std=c++20 %t/A3.cppm -emit-module-interface -o %t/A3.pcm
18 // RUN: %clang_cc1 -std=c++20 %t/TestA3.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
20 // Test again with reduced BMI.
23 // RUN: split-file %s %t
25 // RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
26 // RUN: %clang_cc1 -std=c++20 %t/A0.cppm -emit-reduced-module-interface -o %t/A0.pcm
27 // RUN: %clang_cc1 -std=c++20 %t/TestA.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
29 // RUN: %clang_cc1 -std=c++20 %t/A1.cppm -emit-reduced-module-interface -o %t/A1.pcm
30 // RUN: %clang_cc1 -std=c++20 %t/TestA1.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
32 // RUN: %clang_cc1 -std=c++20 %t/A2.cppm -emit-reduced-module-interface -o %t/A2.pcm
33 // RUN: %clang_cc1 -std=c++20 %t/TestA2.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
35 // RUN: %clang_cc1 -std=c++20 %t/A3.cppm -emit-reduced-module-interface -o %t/A3.pcm
36 // RUN: %clang_cc1 -std=c++20 %t/TestA3.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
41 concept A = requires(const _Tp& __t) { []<class __Up>(const __Up&) {}(__t); };
45 concept A = requires(const _Tp& __t) { []<class __Up>(__Up) {}(__t); };
49 concept A = requires(const _Tp& __t) { []<class __Up>(const __Up& __u) {
55 concept A = requires(const _Tp& __t) { [t = '?']<class __Up>(const __Up&) {
72 // expected-no-diagnostics
77 void f(C) requires(A<C>) {}
90 void f(C) requires(A<C>) {} // expected-error 1+{{reference to 'A' is ambiguous}}
91 // expected-note@* 1+{{candidate found by name lookup is 'A'}}
104 void f(C) requires(A<C>) {} // expected-error 1+{{reference to 'A' is ambiguous}}
105 // expected-note@* 1+{{candidate found by name lookup is 'A'}}
118 void f(C) requires(A<C>) {} // expected-error 1+{{reference to 'A' is ambiguous}}
119 // expected-note@* 1+{{candidate found by name lookup is 'A'}}