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
68 lines
2.8 KiB
C++
68 lines
2.8 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// Verify that the "previous explicit instantiation" note points to the first
|
|
// explicit instantiation statement, not to the implicit instantiation site.
|
|
|
|
namespace GH21133 {
|
|
|
|
template <typename T> void f() {}
|
|
void use_f() { f<int>(); }
|
|
template void f<int>(); // expected-note{{previous explicit instantiation is here}}
|
|
template void f<int>(); // expected-error{{duplicate explicit instantiation of 'f<int>'}}
|
|
|
|
template <typename T> struct S {};
|
|
void use_S(S<int>) {}
|
|
template struct S<int>; // expected-note{{previous explicit instantiation is here}}
|
|
template struct S<int>; // expected-error{{duplicate explicit instantiation of 'S<int>'}}
|
|
|
|
template <typename T> T var = T{};
|
|
int use_var = var<int>;
|
|
template int var<int>; // expected-note{{previous explicit instantiation is here}}
|
|
template int var<int>; // expected-error{{duplicate explicit instantiation of 'var<int>'}}
|
|
|
|
namespace ns {
|
|
template <typename T> void g() {}
|
|
}
|
|
void use_g() { ns::g<double>(); }
|
|
template void ns::g<double>(); // expected-note{{previous explicit instantiation is here}}
|
|
template void ns::g<double>(); // expected-error{{duplicate explicit instantiation of 'g<double>'}}
|
|
|
|
template <typename T> struct Outer {
|
|
template <typename U> void f(U);
|
|
template <typename U> static U var;
|
|
template <typename U> struct Inner {};
|
|
};
|
|
template <typename T> template <typename U> void Outer<T>::f(U) {}
|
|
template <typename T> template <typename U> U Outer<T>::var = U{};
|
|
|
|
void use_members() {
|
|
Outer<int> o;
|
|
o.f<double>(1.0);
|
|
(void)Outer<int>::var<double>;
|
|
Outer<int>::Inner<double> inner;
|
|
}
|
|
|
|
template void Outer<int>::f<double>(double); // expected-note{{previous explicit instantiation is here}}
|
|
template void Outer<int>::f<double>(double); // expected-error{{duplicate explicit instantiation of 'f<double>'}}
|
|
|
|
template double Outer<int>::var<double>; // expected-note{{previous explicit instantiation is here}}
|
|
template double Outer<int>::var<double>; // expected-error{{duplicate explicit instantiation of 'var<double>'}}
|
|
|
|
template struct Outer<int>::Inner<double>; // expected-note{{previous explicit instantiation is here}}
|
|
template struct Outer<int>::Inner<double>; // expected-error{{duplicate explicit instantiation of 'Inner<double>'}}
|
|
|
|
template <typename T> struct A {
|
|
template <typename U> struct B {
|
|
template <typename V> void f(V);
|
|
};
|
|
};
|
|
template <typename T> template <typename U> template <typename V>
|
|
void A<T>::B<U>::f(V) {}
|
|
|
|
void use_nested() { A<int>::B<double> b; b.f<float>(1.0f); }
|
|
|
|
template void A<int>::B<double>::f<float>(float); // expected-note{{previous explicit instantiation is here}}
|
|
template void A<int>::B<double>::f<float>(float); // expected-error{{duplicate explicit instantiation of 'f<float>'}}
|
|
|
|
} // namespace GH21133
|