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
34 lines
965 B
C++
34 lines
965 B
C++
// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
|
|
|
|
void h() {
|
|
int i1 = 0;
|
|
extern void h1(int x = i1);
|
|
// expected-error@-1 {{default argument references local variable 'i1' of enclosing function}}
|
|
|
|
const int i2 = 0;
|
|
extern void h2a(int x = i2); // ok, not odr-use
|
|
extern void h2b(int x = i2 + 0); // ok, not odr-use
|
|
|
|
const int i3 = 0;
|
|
extern void h3(const int *x = &i3);
|
|
// expected-error@-1 {{default argument references local variable 'i3' of enclosing function}}
|
|
|
|
const int i4 = 0;
|
|
extern void h4(int x = sizeof(i4)); // ok, not odr-use
|
|
extern void h5(int x = decltype(i4 + 4)()); // ok, not odr-use
|
|
|
|
union {
|
|
int i5;
|
|
};
|
|
|
|
extern void h6(int = i5);
|
|
// expected-error@-1 {{default argument references local variable '' of enclosing function}}
|
|
|
|
struct S { int i; };
|
|
auto [x] = S();
|
|
|
|
extern void h7(int = x);
|
|
// expected-error@-1 {{default argument references local variable 'x' of enclosing function}}
|
|
|
|
}
|