Debian Codegraph @

clang/test/SemaCXX/cxx2c-enum-compare.cpp

raw
1 // RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify=both,expected
2 // RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify=both -Wno-enum-enum-conversion
3
4 enum E1 { e };
5 enum E2 { f };
6 void test() {
7 int b = e <= 3.7; // both-error {{invalid comparison of enumeration type 'E1' with floating-point type 'double'}}
8 int k = f - e; // expected-error {{invalid arithmetic between different enumeration types ('E2' and 'E1')}}
9 int x = 1 ? e : f; // expected-error {{invalid conditional expression between different enumeration types ('E1' and 'E2')}}
10 }