45 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -x c++ -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm6// RUN: %clang_cc1 -x c++ -std=c++20 %t/B.cppm -I%t -emit-module-interface -o %t/B.pcm7// RUN: %clang_cc1 -x c++ -std=c++20 -fprebuilt-module-path=%t %t/foo.cpp -verify8//9// RUN: rm %t/A.pcm %t/B.pcm10// RUN: %clang_cc1 -x c++ -std=c++20 %t/A.cppm -I%t -emit-reduced-module-interface -o %t/A.pcm11// RUN: %clang_cc1 -x c++ -std=c++20 %t/B.cppm -I%t -emit-reduced-module-interface -o %t/B.pcm12// RUN: %clang_cc1 -x c++ -std=c++20 -fprebuilt-module-path=%t %t/foo.cpp -verify13 14//--- foo.h15template <class T>16concept A = true;17 18//--- bar.h19template <class T>20concept A = false;21 22//--- A.cppm23module;24#include "foo.h"25export module A;26export using ::A;27 28//--- B.cppm29module;30#include "bar.h"31export module B;32export using ::A;33 34//--- foo.cpp35import A;36import B;37 38template <class T> void foo() requires A<T> {} // expected-error 1+{{reference to 'A' is ambiguous}}39 // expected-note@* 1+{{candidate found by name lookup}}40 41int main() {42 foo<int>();43 return 0;44}45