// We may already have an enum of the same name; try to find and match it.
if (!DC->isFunctionOrMethod() && SearchName) {
SmallVector<NamedDecl *, 4> ConflictingDecls;
- for (DeclContext::lookup_result Lookup = DC->lookup(Name);
+ for (DeclContext::lookup_result Lookup = DC->lookup(SearchName);
Lookup.first != Lookup.second;
++Lookup.first) {
if (!(*Lookup.first)->isInIdentifierNamespace(IDNS))
RecordDecl *AdoptDecl = 0;
if (!DC->isFunctionOrMethod() && SearchName) {
SmallVector<NamedDecl *, 4> ConflictingDecls;
- for (DeclContext::lookup_result Lookup = DC->lookup(Name);
+ for (DeclContext::lookup_result Lookup = DC->lookup(SearchName);
Lookup.first != Lookup.second;
++Lookup.first) {
if (!(*Lookup.first)->isInIdentifierNamespace(IDNS))