[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / concept_differ.cpp
blob9c1d292f29274b425e5caf974312c6c6a9eda028
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: split-file %s %t
4 //
5 // RUN: %clang_cc1 -x c++ -std=c++20 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/module.modulemap %t/foo.cpp -verify
7 //--- module.modulemap
8 module "foo" {
9 export *
10 header "foo.h"
12 module "bar" {
13 export *
14 header "bar.h"
17 //--- foo.h
18 template <class T>
19 concept A = true;
21 //--- bar.h
22 template <class T>
23 concept A = false;
25 //--- foo.cpp
26 #include "bar.h"
27 #include "foo.h"
29 template <class T> void foo() requires A<T> {} // expected-error 1+{{reference to 'A' is ambiguous}}
30 // expected-note@* 1+{{candidate found by name lookup}}
32 int main() {
33 foo<int>();
34 return 0;