[PATCH] D138091: [Clang] Fix Sema::ClassifyName so that it classifies EnumConstantDecl as NonType when they are brought into scope via using enum
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 21 09:17:07 PST 2022
aaron.ballman added inline comments.
================
Comment at: clang/lib/Sema/SemaDecl.cpp:1250-1251
bool ADL = UseArgumentDependentLookup(SS, Result, NextToken.is(tok::l_paren));
- if (Result.isSingleResult() && !ADL && !FirstDecl->isCXXClassMember())
+ if (Result.isSingleResult() && !ADL &&
+ (!FirstDecl->isCXXClassMember() || isa<EnumConstantDecl>(FirstDecl)))
return NameClassification::NonType(Result.getRepresentativeDecl());
----------------
This change looks correct to me -- enum constants are class members but are certainly not forming an overload set!
Did you audit the other places we call `isCXXClassMember()` to ensure they're sensible regarding enum constant declarations?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138091/new/
https://reviews.llvm.org/D138091
More information about the cfe-commits
mailing list