Files
TheRock/compiler/amd-llvm/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p5-ex2.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

67 lines
1.7 KiB
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
// RUN: cd %t
//
// RUN: %clang_cc1 -std=c++20 M.cpp -emit-module-interface -o M.pcm
// RUN: %clang_cc1 -std=c++20 N.cpp -emit-module-interface -o N.pcm \
// RUN: -fmodule-file=M=M.pcm
// RUN: %clang_cc1 -std=c++20 Q.cpp -emit-module-interface -o Q.pcm
// RUN: %clang_cc1 -std=c++20 Q-impl.cpp -fsyntax-only -fmodule-file=Q=Q.pcm \
// RUN: -fmodule-file=N=N.pcm -fmodule-file=M=M.pcm -verify
//--- M.cpp
export module M;
namespace R {
export struct X {};
export void f(X);
} // namespace R
namespace S {
export void f(R::X, R::X);
}
//--- N.cpp
export module N;
import M;
export R::X make();
namespace R {
static int g(X);
}
export template <typename T, typename U>
void apply(T t, U u) {
f(t, u);
g(t);
}
//--- Q.cpp
export module Q;
//--- Q-impl.cpp
module Q;
import N;
namespace S {
struct Z {
template <typename T> operator T();
};
} // namespace S
void test() {
// OK, decltype(x) is R::X in module M
auto x = make();
// error: R and R::f are not visible here
R::f(x); // expected-error {{no type named 'f' in namespace 'R'}}
f(x); // Found by [basic.lookup.argdep] / p4.3
// error: S::f in module M not considered even though S is an associated
// namespace, since the entity Z is in a different module from f.
f(x, S::Z()); // expected-error {{no matching function for call to 'f'}}
// expected-note@M.cpp:4 {{candidate function not viable: requires 1 argument, but 2 were provided}}
// error: S::f is visible in instantiation context, but R::g has internal
// linkage and cannot be used outside N.cpp
apply(x, S::Z()); // expected-error@N.cpp:10 {{use of undeclared identifier 'g'}}
// expected-note@-1 {{requested here}}
}