| // RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm |
| // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp \ |
| // RUN: -fsyntax-only -verify |
| // RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-module-interface -o %t/B.pcm |
| // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp \ |
| // RUN: -fsyntax-only -verify -DIMPORT_MODULE_B |
| export using ::NoNameEntity; |
| export constexpr A a_a{}; |
| export constexpr NoNameEntity NoName_a{}; |
| export constexpr U u_a{}; |
| export using ::NoNameEntity; |
| export constexpr A a_b{}; |
| export constexpr NoNameEntity NoName_b{}; |
| export constexpr U u_b{}; |
| // expected-no-diagnostics |
| static_assert(__is_same(decltype(a_a), decltype(a_b))); |
| static_assert(__is_same(decltype(NoName_a), decltype(NoName_b))); |
| static_assert(__is_same(decltype(u_a), decltype(u_b))); |
| A a; // Shouldn't be ambiguous after import B; |