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
59 lines
1.8 KiB
C++
59 lines
1.8 KiB
C++
// RUN: rm -rf %t
|
|
// RUN: mkdir %t
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %clang_cc1 -std=c++20 %t/std-10-4-ex2-interface.cppm -emit-reduced-module-interface \
|
|
// RUN: -o %t/M.pcm -Wno-unused-value
|
|
// RUN: %clang_cc1 -std=c++20 %t/std-10-4-ex2-implementation.cpp -fmodule-file=M=%t/M.pcm \
|
|
// RUN: -fsyntax-only -verify -Wno-unused-value
|
|
|
|
//--- std-10-4-ex2.h
|
|
|
|
namespace N {
|
|
struct X {};
|
|
int d();
|
|
int e();
|
|
inline int f(X, int = d()) { return e(); }
|
|
int g(X);
|
|
int h(X);
|
|
} // namespace N
|
|
|
|
//--- std-10-4-ex2-interface.cppm
|
|
module;
|
|
#include "std-10-4-ex2.h"
|
|
export module M;
|
|
|
|
template <typename T> int use_f() {
|
|
N::X x; // N::X, N, and :: are decl-reachable from use_f
|
|
return f(x, 123); // N::f is decl-reachable from use_f,
|
|
// N::e is indirectly decl-reachable from use_f
|
|
// because it is decl-reachable from N::f, and
|
|
// N::d is decl-reachable from use_f
|
|
// because it is decl-reachable from N::f
|
|
// even though it is not used in this call
|
|
}
|
|
|
|
template <typename T> int use_g() {
|
|
N::X x; // N::X, N, and :: are decl-reachable from use_g
|
|
return g((T(), x)); // N::g is not decl-reachable from use_g
|
|
}
|
|
|
|
template <typename T> int use_h() {
|
|
N::X x; // N::X, N, and :: are decl-reachable from use_h
|
|
return h((T(), x)); // N::h is not decl-reachable from use_h, but
|
|
// N::h is decl-reachable from use_h<int>
|
|
}
|
|
|
|
int k = use_h<int>();
|
|
// use_h<int> is decl-reachable from k, so
|
|
// N::h is decl-reachable from k
|
|
|
|
//--- std-10-4-ex2-implementation.cpp
|
|
module M;
|
|
|
|
int a = use_f<int>();
|
|
int b = use_g<int>();
|
|
// expected-error@std-10-4-ex2-interface.cppm:17 {{use of undeclared identifier 'g'}}
|
|
// expected-note@-2 {{in instantiation of function template specialization 'use_g<int>' requested here}}
|
|
int c = use_h<int>();
|