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
79 lines
2.5 KiB
C++
79 lines
2.5 KiB
C++
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
|
|
//
|
|
// This test checks that a deprecated attribute on an alias
|
|
// template triggers a warning diagnostic when it is used.
|
|
|
|
template <typename T>
|
|
struct NoAttr {
|
|
void foo() {}
|
|
};
|
|
|
|
// expected-note@+2 7{{'UsingWithAttr' has been explicitly marked deprecated here}}
|
|
template <typename T>
|
|
using UsingWithAttr __attribute__((deprecated)) = NoAttr<T>;
|
|
|
|
// expected-note@+1 {{'UsingInstWithAttr' has been explicitly marked deprecated here}}
|
|
using UsingInstWithAttr __attribute__((deprecated)) = NoAttr<int>;
|
|
|
|
// expected-note@+1 {{'TDWithAttr' has been explicitly marked deprecated here}}
|
|
typedef NoAttr<int> TDWithAttr __attribute__((deprecated));
|
|
|
|
// expected-warning@+1 {{'UsingWithAttr' is deprecated}}
|
|
typedef UsingWithAttr<int> TDUsingWithAttr;
|
|
|
|
typedef NoAttr<int> TDNoAttr;
|
|
|
|
// expected-note@+1 {{'UsingTDWithAttr' has been explicitly marked deprecated here}}
|
|
using UsingTDWithAttr __attribute__((deprecated)) = TDNoAttr;
|
|
|
|
struct S {
|
|
NoAttr<float> f1;
|
|
// expected-warning@+1 {{'UsingWithAttr' is deprecated}}
|
|
UsingWithAttr<float> f2;
|
|
};
|
|
|
|
// expected-warning@+1 {{'UsingWithAttr' is deprecated}}
|
|
void foo(NoAttr<short> s1, UsingWithAttr<short> s2) {
|
|
}
|
|
|
|
// expected-note@+2 {{'UsingWithCPPAttr' has been explicitly marked deprecated here}}
|
|
template <typename T>
|
|
using UsingWithCPPAttr [[deprecated]] = NoAttr<T>;
|
|
|
|
// expected-note@+1 {{'UsingInstWithCPPAttr' has been explicitly marked deprecated here}}
|
|
using UsingInstWithCPPAttr [[deprecated("Do not use this")]] = NoAttr<int>;
|
|
|
|
void bar() {
|
|
NoAttr<int> obj; // Okay
|
|
|
|
// expected-warning@+1 {{'UsingWithAttr' is deprecated}}
|
|
UsingWithAttr<int> objUsingWA;
|
|
|
|
// expected-warning@+1 {{'UsingWithAttr' is deprecated}}
|
|
NoAttr<UsingWithAttr<int>> s;
|
|
|
|
// expected-note@+1 {{'DepInt' has been explicitly marked deprecated here}}
|
|
using DepInt [[deprecated]] = int;
|
|
// expected-warning@+2 {{'UsingWithAttr' is deprecated}}
|
|
// expected-warning@+1 {{'DepInt' is deprecated}}
|
|
using X = UsingWithAttr<DepInt>;
|
|
|
|
// expected-warning@+1 {{'UsingWithAttr' is deprecated}}
|
|
UsingWithAttr<int>().foo();
|
|
|
|
// expected-warning@+1 {{'UsingInstWithAttr' is deprecated}}
|
|
UsingInstWithAttr objUIWA;
|
|
|
|
// expected-warning@+1 {{'TDWithAttr' is deprecated}}
|
|
TDWithAttr objTDWA;
|
|
|
|
// expected-warning@+1 {{'UsingTDWithAttr' is deprecated}}
|
|
UsingTDWithAttr objUTDWA;
|
|
|
|
// expected-warning@+1 {{'UsingWithCPPAttr' is deprecated}}
|
|
UsingWithCPPAttr<int> objUsingWCPPA;
|
|
|
|
// expected-warning@+1 {{'UsingInstWithCPPAttr' is deprecated: Do not use this}}
|
|
UsingInstWithCPPAttr objUICPPWA;
|
|
}
|