Skip to content

Commit ab9d87b

Browse files
committed
[Clang] Update existing tests to reflect new diagnostics for scoped enums
1 parent 214a954 commit ab9d87b

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum class E { e };
1313

1414
template<typename T> int f(T t) { return ~t; } // expected-error {{invalid argument type}}
1515
template<typename T, typename U> int f(T t, U u) { return t % u; } // expected-error {{invalid operands to}}
16+
// expected-note@-1 {{no implicit conversion for scoped enum}}
1617

1718
int b1 = ~E::e; // expected-error {{invalid argument type}}
1819
int b2 = f(E::e); // expected-note {{in instantiation of}}

clang/test/SemaCXX/enum-scoped.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ namespace rdar9366066 {
128128

129129
void f(X x) {
130130
x % X::value; // expected-error{{invalid operands to binary expression ('X' and 'rdar9366066::X')}}
131+
// expected-note@-1{{no implicit conversion for scoped enum; consider casting to underlying type}}
132+
// expected-note@-2{{no implicit conversion for scoped enum; consider casting to underlying type}}
131133
x % 8; // expected-error{{invalid operands to binary expression ('X' and 'int')}}
134+
// expected-note@-1{{no implicit conversion for scoped enum; consider casting to underlying type}}
132135
}
133136
}
134137

clang/test/SemaCXX/opaque-enum-declaration-in-class-template.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ struct S5 {
9494
};
9595

9696
int X5 = S5<char>::E1{} + '\0'; // expected-error{{invalid operands to binary expression}}
97+
// expected-note@-1{{no implicit conversion for scoped enum; consider casting to underlying type}}
9798
int Y5 = S5<char>::E2{} + '\0'; // expected-error{{invalid operands to binary expression}}
99+
// expected-note@-1{{no implicit conversion for scoped enum; consider casting to underlying type}}
98100

99101

100102
template <typename T>

0 commit comments

Comments
 (0)