Patch by: Reka Nikolett Kovacs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310468
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!CondEnumType || !CaseEnumType)
return;
+ // Ignore anonymous enums.
+ if (!CondEnumType->getDecl()->getIdentifier())
+ return;
+ if (!CaseEnumType->getDecl()->getIdentifier())
+ return;
+
if (S.Context.hasSameUnqualifiedType(CondType, CaseType))
return;
case BarF: break;
case FooA: break; // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
}
+
+ switch(x) {
+ case AnonAA: break; // expected-warning {{case value not in enumerated type 'Foo'}}
+ case FooA: break;
+ case FooB: break;
+ case FooC: break;
+ }
}