[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 1 07:53:34 PDT 2024
================
@@ -1735,48 +1757,21 @@ MemberExpr *MemberExpr::Create(
ValueDecl *MemberDecl, DeclAccessPair FoundDecl,
DeclarationNameInfo NameInfo, const TemplateArgumentListInfo *TemplateArgs,
QualType T, ExprValueKind VK, ExprObjectKind OK, NonOdrUseReason NOUR) {
- bool HasQualOrFound = QualifierLoc || FoundDecl.getDecl() != MemberDecl ||
- FoundDecl.getAccess() != MemberDecl->getAccess();
+ bool HasQualifier = QualifierLoc.hasQualifier();
+ bool HasFoundDecl = FoundDecl.getDecl() != MemberDecl ||
+ FoundDecl.getAccess() != MemberDecl->getAccess();
bool HasTemplateKWAndArgsInfo = TemplateArgs || TemplateKWLoc.isValid();
std::size_t Size =
- totalSizeToAlloc<MemberExprNameQualifier, ASTTemplateKWAndArgsInfo,
- TemplateArgumentLoc>(
- HasQualOrFound ? 1 : 0, HasTemplateKWAndArgsInfo ? 1 : 0,
+ totalSizeToAlloc<NestedNameSpecifierLoc, DeclAccessPair,
+ ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
+ HasQualifier ? 1 : 0, HasFoundDecl ? 1 : 0,
----------------
erichkeane wrote:
Please just use the variable itself instead of ternary; bool-to-int conversion is well defined.
https://github.com/llvm/llvm-project/pull/86682
More information about the cfe-commits
mailing list