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
95 lines
2.8 KiB
C++
95 lines
2.8 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
|
|
|
struct C { };
|
|
|
|
template<typename T>
|
|
struct X0 {
|
|
T value; // expected-error{{incomplete}}
|
|
};
|
|
|
|
// Explicitly instantiate a class template specialization
|
|
template struct X0<int>;
|
|
template struct X0<void>; // expected-note{{instantiation}}
|
|
|
|
// Explicitly instantiate a function template specialization
|
|
template<typename T>
|
|
void f0(T t) {
|
|
++t; // expected-error{{cannot increment}}
|
|
}
|
|
|
|
template void f0(int);
|
|
template void f0<long>(long);
|
|
template void f0<>(unsigned);
|
|
template void f0(int C::*); // expected-note{{instantiation}}
|
|
|
|
// Explicitly instantiate a member template specialization
|
|
template<typename T>
|
|
struct X1 {
|
|
template<typename U>
|
|
struct Inner {
|
|
T member1;
|
|
U member2; // expected-error{{incomplete}}
|
|
};
|
|
|
|
template<typename U>
|
|
void f(T& t, U u) {
|
|
t = u; // expected-error{{incompatible}}
|
|
}
|
|
};
|
|
|
|
template struct X1<int>::Inner<float>;
|
|
template struct X1<int>::Inner<double>;
|
|
template struct X1<int>::Inner<void>; // expected-note{{instantiation}}
|
|
|
|
template void X1<int>::f(int&, float);
|
|
template void X1<int>::f<long>(int&, long);
|
|
template void X1<int>::f<>(int&, double);
|
|
template void X1<int>::f<>(int&, int*); // expected-note{{instantiation}}
|
|
|
|
// Explicitly instantiate members of a class template
|
|
struct Incomplete; // expected-note{{forward declaration}}
|
|
struct NonDefaultConstructible { // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
|
#if __cplusplus >= 201103L // C++11 or later
|
|
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
|
#endif
|
|
NonDefaultConstructible(int); // expected-note{{candidate constructor}}
|
|
};
|
|
|
|
template<typename T, typename U>
|
|
struct X2 {
|
|
void f(T &t, U u) {
|
|
t = u; // expected-error{{incompatible}}
|
|
}
|
|
|
|
struct Inner {
|
|
T member1;
|
|
U member2; // expected-error{{incomplete}}
|
|
};
|
|
|
|
static T static_member1;
|
|
static U static_member2;
|
|
};
|
|
|
|
template<typename T, typename U>
|
|
T X2<T, U>::static_member1 = 17; // expected-error{{cannot initialize}}
|
|
|
|
template<typename T, typename U>
|
|
U X2<T, U>::static_member2; // expected-error{{no matching}}
|
|
|
|
template void X2<int, float>::f(int &, float);
|
|
template void X2<int, float>::f(int &, double); // expected-error{{does not refer}}
|
|
template void X2<int, int*>::f(int&, int*); // expected-note{{instantiation}}
|
|
|
|
template struct X2<int, float>::Inner;
|
|
template struct X2<int, Incomplete>::Inner; // expected-note{{instantiation}}
|
|
|
|
template int X2<int, float>::static_member1;
|
|
template int* X2<int*, float>::static_member1; // expected-note{{instantiation}}
|
|
template
|
|
NonDefaultConstructible X2<NonDefaultConstructible, int>::static_member1;
|
|
|
|
template
|
|
NonDefaultConstructible X2<int, NonDefaultConstructible>::static_member2; // expected-note{{instantiation}}
|