3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/same_as.cppm -o %t/same_as.pcm
6 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t %t/concepts.cppm -o %t/concepts.pcm
7 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t %t/format.cppm -o %t/format.pcm
8 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/conflicting.cppm -o %t/conflicting.pcm
9 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cppm -fsyntax-only -verify
11 // Test again with reduced BMI.
14 // RUN: split-file %s %t
16 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/same_as.cppm -o %t/same_as.pcm
17 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/concepts.cppm -o %t/concepts.pcm
18 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/format.cppm -o %t/format.pcm
19 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/conflicting.cppm -o %t/conflicting.pcm
20 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cppm -fsyntax-only -verify
24 export module same_as
;
25 export
template <class T
, class U
>
26 concept same_as
= __is_same(T
, U
);
29 export module concepts
;
30 export import same_as
;
32 export
template <class T
>
33 concept ConflictingConcept
= true;
38 export import concepts
;
39 export import same_as
;
41 export
template <class T
> void foo()
42 requires same_as
<T
, int>
45 //--- conflicting.cppm
46 export module conflicting
;
47 export
template <class T
, class U
= int>
48 concept ConflictingConcept
= true;
54 template <class T
> void foo()
55 requires same_as
<T
, T
>
57 ConflictingConcept
auto x
= 10; // expected-error {{reference to 'ConflictingConcept' is ambiguous}}
58 // expected-note@* 2 {{candidate}}