Files
TheRock/compiler/amd-llvm/clang/test/Parser/cxx11-stmt-attributes.cpp
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

86 lines
5.3 KiB
C++

// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 %s
void foo(int i) {
[[unknown_attribute]] ; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] { } // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] if (0) { } // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] for (;;); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] do { // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] continue; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
} while (0);
[[unknown_attribute]] while (0); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] switch (i) { // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] case 0: // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] default: // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] break; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
}
[[unknown_attribute]] goto here; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] here: // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unknown_attribute]] try { // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
} catch (...) {
}
[[unknown_attribute]] return; // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
alignas(8) ; // expected-error {{'alignas' attribute cannot be applied to a statement}}
[[noreturn]] { } // expected-error {{'noreturn' attribute cannot be applied to a statement}}
[[noreturn]] if (0) { } // expected-error {{'noreturn' attribute cannot be applied to a statement}}
[[noreturn]] for (;;); // expected-error {{'noreturn' attribute cannot be applied to a statement}}
[[noreturn]] do { // expected-error {{'noreturn' attribute cannot be applied to a statement}}
[[unavailable]] continue; // expected-warning {{unknown attribute 'unavailable' ignored}}
} while (0);
[[unknown_attributqqq]] while (0); // expected-warning {{unknown attribute 'unknown_attributqqq' ignored}}
// TODO: remove 'qqq' part and enjoy 'empty loop body' warning here (DiagnoseEmptyLoopBody)
[[unknown_attribute]] while (0); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
[[unused]] switch (i) { // expected-warning {{unknown attribute 'unused' ignored}}
[[uuid]] case 0: // expected-warning {{unknown attribute 'uuid' ignored}}
[[visibility]] default: // expected-warning {{unknown attribute 'visibility' ignored}}
[[carries_dependency]] break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
}
[[fastcall]] goto there; // expected-warning {{unknown attribute 'fastcall' ignored}}
[[noinline]] there: // expected-warning {{unknown attribute 'noinline' ignored}}
[[lock_returned]] try { // expected-warning {{unknown attribute 'lock_returned' ignored}}
} catch (...) {
}
[[weakref]] return; // expected-warning {{unknown attribute 'weakref' ignored}}
[[carries_dependency]] ; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] { } // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] if (0) { } // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] for (;;); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] do { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] continue; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}}
} while (0);
[[carries_dependency]] while (0); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] switch (i) { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}}
[[carries_dependency]] case 0: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] default: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
}
[[carries_dependency]] goto here; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
[[carries_dependency]] try { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
} catch (...) {
}
[[carries_dependency]] return; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
{
[[ ]] // expected-error {{an attribute list cannot appear here}}
#pragma STDC FP_CONTRACT ON // expected-error {{can only appear at file scope or at the start of a compound statement}}
#pragma clang fp contract(fast) // expected-error {{can only appear at file scope or at the start of a compound statement}}
}
}