36 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -x c++ -std=c++20 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/module.modulemap %t/foo.cpp -verify6 7//--- module.modulemap8module "foo" {9 export * 10 header "foo.h"11}12module "bar" {13 export * 14 header "bar.h"15}16 17//--- foo.h18template <class T>19concept A = true;20 21//--- bar.h22template <class T>23concept A = false;24 25//--- foo.cpp26#include "bar.h"27#include "foo.h"28 29template <class T> void foo() requires A<T> {} // expected-error 1+{{reference to 'A' is ambiguous}}30 // expected-note@* 1+{{candidate found by name lookup}}31 32int main() {33 foo<int>();34 return 0;35}36