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.6 KiB
Plaintext
79 lines
2.6 KiB
Plaintext
// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions %s
|
|
|
|
@interface NSException
|
|
@end
|
|
|
|
// @throw
|
|
template<typename T>
|
|
void throw_test(T value) {
|
|
@throw value; // expected-error{{@throw requires an Objective-C object type ('int' invalid)}}
|
|
}
|
|
|
|
template void throw_test(NSException *);
|
|
template void throw_test(int); // expected-note{{in instantiation of}}
|
|
|
|
// @synchronized
|
|
template<typename T>
|
|
void synchronized_test(T value) {
|
|
@synchronized (value) { // expected-error{{@synchronized requires an Objective-C object type ('int' invalid)}}
|
|
value = 0;
|
|
}
|
|
}
|
|
|
|
template void synchronized_test(NSException *);
|
|
template void synchronized_test(int); // expected-note{{in instantiation of}}
|
|
|
|
// fast enumeration
|
|
@interface NSArray
|
|
- (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount;
|
|
@end
|
|
|
|
@interface NSString
|
|
@end
|
|
|
|
struct vector {};
|
|
|
|
template<typename T> void eat(T);
|
|
|
|
template<typename E, typename T>
|
|
void fast_enumeration_test(T collection) {
|
|
for (E element in collection) { // expected-error{{selector element type 'int' is not a valid object}} \
|
|
// expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
|
|
eat(element);
|
|
}
|
|
|
|
E element;
|
|
for (element in collection) // expected-error{{selector element type 'int' is not a valid object}} \
|
|
// expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
|
|
eat(element);
|
|
|
|
for (NSString *str in collection) // expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
|
|
eat(str);
|
|
|
|
NSString *str;
|
|
for (str in collection) // expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
|
|
eat(str);
|
|
}
|
|
|
|
template void fast_enumeration_test<NSString *>(NSArray*);
|
|
template void fast_enumeration_test<int>(NSArray*); // expected-note{{in instantiation of}}
|
|
template void fast_enumeration_test<NSString *>(vector); // expected-note{{in instantiation of}}
|
|
|
|
// @try/@catch/@finally
|
|
|
|
template<typename T, typename U>
|
|
void try_catch_finally_test(U value) {
|
|
@try {
|
|
value = 1; // expected-error{{incompatible integer to pointer conversion assigning to 'int *' from 'int'}}
|
|
}
|
|
@catch (T obj) { // expected-error{{@catch parameter is not a pointer to an interface type}}
|
|
id x = obj;
|
|
} @finally {
|
|
value = 0;
|
|
}
|
|
}
|
|
|
|
template void try_catch_finally_test<NSString *>(int);
|
|
template void try_catch_finally_test<NSString *>(int*); // expected-note{{in instantiation of}}
|
|
template void try_catch_finally_test<NSString>(int); // expected-note{{in instantiation of function template specialization 'try_catch_finally_test<NSString, int>' requested here}}
|