Skip to content

Commit 66990b5

Browse files
committed
Adding test to confirm we don't create enumerator that shadows.
1 parent 41e1b10 commit 66990b5

File tree

1 file changed

+9
-0
lines changed
  • clang/test/CXX/class/class.mem

1 file changed

+9
-0
lines changed

clang/test/CXX/class/class.mem/p13.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,12 @@ template<typename B> struct CtorDtorName : B {
114114
CtorDtorName();
115115
~CtorDtorName(); // expected-error {{identifier 'CtorDtorName' after '~' in destructor name does not name a type}}
116116
};
117+
118+
struct S {
119+
enum E {
120+
R = 11,
121+
S = 12 // expected-error{{member 'S' has the same name as its class}}
122+
};
123+
static_assert(E::R == 11, "E::R is not 11");
124+
static_assert(E::S == 12, "E::S is not 12"); // expected-error{{no member named 'S' in 'S::E'}}
125+
};

0 commit comments

Comments
 (0)