[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / cxx2c-enum-compare.cpp
blobf47278a60725e8ef17da80ae240287e96a304f97
1 // RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify -triple %itanium_abi_triple
3 enum E1 { e };
4 enum E2 { f };
5 void test() {
6 int b = e <= 3.7; // expected-error {{invalid comparison of enumeration type 'E1' with floating-point type 'double'}}
7 int k = f - e; // expected-error {{invalid arithmetic between different enumeration types ('E2' and 'E1')}}
8 int x = 1 ? e : f; // expected-error {{invalid conditional expression between different enumeration types ('E1' and 'E2')}}