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
55 lines
4.0 KiB
C++
55 lines
4.0 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify %s
|
|
|
|
// Check that we emit the correct warnings in various situations where the C++11
|
|
// spelling of the `address_space` attribute is applied to a declaration instead
|
|
// of a type. Also check that the attribute can instead be applied to the type.
|
|
|
|
void f([[clang::address_space(1)]] int* param) { // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
[[clang::address_space(1)]] int* local1; // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
int* local2 [[clang::address_space(1)]]; // expected-error {{automatic variable qualified with an address space}} expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
int [[clang::address_space(1)]] * local3;
|
|
int* [[clang::address_space(1)]] local4; // expected-error {{automatic variable qualified with an address space}}
|
|
|
|
for ([[clang::address_space(1)]] int* p = nullptr; p; ++p) {} // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
for (; [[clang::address_space(1)]] int* p = nullptr; ) {} // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
while([[clang::address_space(1)]] int* p = nullptr) {} // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
if ([[clang::address_space(1)]] int* p = nullptr) {} // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
try {
|
|
} catch([[clang::address_space(1)]] int& i) { // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
}
|
|
|
|
for (int [[clang::address_space(1)]] * p = nullptr; p; ++p) {}
|
|
for (; int [[clang::address_space(1)]] * p = nullptr; ) {}
|
|
while(int [[clang::address_space(1)]] * p = nullptr) {}
|
|
if (int [[clang::address_space(1)]] * p = nullptr) {}
|
|
try {
|
|
} catch(int [[clang::address_space(1)]] & i) {
|
|
}
|
|
}
|
|
|
|
[[clang::address_space(1)]] int* return_value(); // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
int [[clang::address_space(1)]] * return_value();
|
|
|
|
[[clang::address_space(1)]] int global1; // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
int global2 [[clang::address_space(1)]]; // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
int [[clang::address_space(1)]] global3;
|
|
int [[clang::address_space(1)]] global4;
|
|
|
|
struct [[clang::address_space(1)]] S { // expected-error {{'clang::address_space' attribute cannot be applied to a declaration}}
|
|
[[clang::address_space(1)]] int* member_function_1(); // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
int [[clang::address_space(1)]] * member_function_2();
|
|
};
|
|
|
|
template <class T>
|
|
[[clang::address_space(1)]] T var_template_1; // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
template <class T>
|
|
T [[clang::address_space(1)]] var_template_2;
|
|
|
|
using void_ptr [[clang::address_space(1)]] = void *; // expected-warning {{applying attribute 'clang::address_space' to a declaration is deprecated; apply it to the type instead}}
|
|
// Intentionally using the same alias name to check that the aliases define the
|
|
// same type.
|
|
using void_ptr = void [[clang::address_space(1)]] *;
|
|
|
|
namespace N {}
|
|
[[clang::address_space(1)]] using namespace N; // expected-error {{'clang::address_space' attribute cannot be applied to a declaration}}
|