aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/concept_differ.cpp
blob: 9c1d292f29274b425e5caf974312c6c6a9eda028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -x c++ -std=c++20 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/module.modulemap %t/foo.cpp -verify

//--- module.modulemap
module "foo" {
  export * 
  header "foo.h"
}
module "bar" {
  export * 
  header "bar.h"
}

//--- foo.h
template <class T>
concept A = true;

//--- bar.h
template <class T>
concept A = false;

//--- foo.cpp
#include "bar.h"
#include "foo.h"

template <class T> void foo() requires A<T> {}  // expected-error 1+{{reference to 'A' is ambiguous}}
                                                // expected-note@* 1+{{candidate found by name lookup}}

int main() {
  foo<int>();
  return 0;
}