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
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
template<typename T>
|
|
struct X0 {
|
|
void f();
|
|
|
|
template<typename U>
|
|
void g(U);
|
|
|
|
struct Nested {
|
|
};
|
|
|
|
static T member;
|
|
};
|
|
|
|
int &use_X0_int(X0<int> x0i, // expected-note{{implicit instantiation first required here}}
|
|
int i) {
|
|
x0i.f(); // expected-note{{implicit instantiation first required here}}
|
|
x0i.g(i); // expected-note{{implicit instantiation first required here}}
|
|
X0<int>::Nested nested; // expected-note{{implicit instantiation first required here}}
|
|
return X0<int>::member; // expected-note{{implicit instantiation first required here}}
|
|
}
|
|
|
|
template<>
|
|
void X0<int>::f() { // expected-error{{after instantiation}}
|
|
}
|
|
|
|
template<> template<>
|
|
void X0<int>::g(int) { // expected-error{{after instantiation}}
|
|
}
|
|
|
|
template<>
|
|
struct X0<int>::Nested { }; // expected-error{{after instantiation}}
|
|
|
|
template<>
|
|
int X0<int>::member = 17; // expected-error{{after instantiation}}
|
|
|
|
template<>
|
|
struct X0<int> { }; // expected-error{{after instantiation}}
|
|
|
|
// Example from the standard
|
|
template<class T> class Array { /* ... */ };
|
|
|
|
template<class T> void sort(Array<T>& v) { /* ... */ }
|
|
|
|
struct String {};
|
|
|
|
void f(Array<String>& v) {
|
|
|
|
sort(v); // expected-note{{required}}
|
|
// use primary template
|
|
// sort(Array<T>&), T is String
|
|
}
|
|
|
|
template<> void sort<String>(Array<String>& v); // // expected-error{{after instantiation}}
|
|
template<> void sort<>(Array<char*>& v); // OK: sort<char*> not yet used
|
|
|
|
namespace PR6160 {
|
|
template<typename T> void f(T);
|
|
template<> void f(int);
|
|
extern template void f(int);
|
|
template<> void f(int) { }
|
|
}
|