Files
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

109 lines
1.8 KiB
C

// RUN: %clang_cc1 %s -fsyntax-only -verify -Wduplicate-enum
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -x c++ -DCPP -fsyntax-only -verify -Wduplicate-enum
enum A {
A1 = 0, // expected-note {{element 'A1' also has value 0}}
A2 = -1,
A3, // expected-warning {{element 'A3' has been implicitly assigned 0 which another element has been assigned}}
A4};
enum B {
B1 = -1, // expected-note {{element 'B1' also has value -1}}
B2, // expected-warning {{element 'B2' has been implicitly assigned 0 which another element has been assigned}}
B3,
B4 = -2,
B5, // expected-warning {{element 'B5' has been implicitly assigned -1 which another element has been assigned}}
B6 // expected-note {{element 'B6' also has value 0}}
};
enum C { C1, C2 = -1, C3 }; // expected-warning{{element 'C1' has been implicitly assigned 0 which another element has been assigned}} \
// expected-note {{element 'C3' also has value 0}}
enum D {
D1,
D2,
D3, // expected-warning{{element 'D3' has been implicitly assigned 2 which another element has been assigned}}
D4 = D2, // no warning
D5 = 2 // expected-note {{element 'D5' also has value 2}}
};
enum E {
E1,
E2 = E1,
E3 = E2
};
enum F {
F1,
F2,
FCount,
FMax = FCount - 1
};
enum G {
G1,
G2,
GMax = G2,
GCount = GMax + 1
};
enum {
H1 = 0,
H2 = -1,
H3,
H4};
enum {
I1 = -1,
I2,
I3,
I4 = -2,
I5,
I6
};
enum { J1, J2 = -1, J3 };
enum {
K1,
K2,
K3,
K4 = K2,
K5 = 2
};
enum {
L1,
L2 = L1,
L3 = L2
};
enum {
M1,
M2,
MCount,
MMax = MCount - 1
};
enum {
N1,
N2,
NMax = N2,
NCount = NMax + 1
};
// PR15693
enum enum1 {
VALUE // expected-note{{previous definition is here}}
};
enum enum2 {
VALUE // expected-error{{redefinition of enumerator 'VALUE'}}
};
#ifdef CPP
enum BigEnumerators : long {
e1,
e2 = __LONG_MAX__,
};
#endif