File tree Expand file tree Collapse file tree 2 files changed +9
-25
lines changed Expand file tree Collapse file tree 2 files changed +9
-25
lines changed Original file line number Diff line number Diff line change @@ -1517,14 +1517,8 @@ class CXXRecordDecl : public RecordDecl {
1517
1517
// / returns false if the class has non-computable base classes.
1518
1518
// /
1519
1519
// / \param BaseMatches Callback invoked for each (direct or indirect) base
1520
- // / class of this type, or if \p AllowShortCircuit is true then until a call
1521
- // / returns false.
1522
- // /
1523
- // / \param AllowShortCircuit if false, forces the callback to be called
1524
- // / for every base class, even if a dependent or non-matching base was
1525
- // / found.
1526
- bool forallBases (ForallBasesCallback BaseMatches,
1527
- bool AllowShortCircuit = true ) const ;
1520
+ // / class of this type until a call returns false.
1521
+ bool forallBases (ForallBasesCallback BaseMatches) const ;
1528
1522
1529
1523
// / Function type used by lookupInBases() to determine whether a
1530
1524
// / specific base class subobject matches the lookup criteria.
Original file line number Diff line number Diff line change @@ -147,45 +147,35 @@ CXXRecordDecl::isCurrentInstantiation(const DeclContext *CurContext) const {
147
147
return false ;
148
148
}
149
149
150
- bool CXXRecordDecl::forallBases (ForallBasesCallback BaseMatches,
151
- bool AllowShortCircuit) const {
150
+ bool CXXRecordDecl::forallBases (ForallBasesCallback BaseMatches) const {
152
151
SmallVector<const CXXRecordDecl*, 8 > Queue;
153
152
154
153
const CXXRecordDecl *Record = this ;
155
- bool AllMatches = true ;
156
154
while (true ) {
157
155
for (const auto &I : Record->bases ()) {
158
156
const RecordType *Ty = I.getType ()->getAs <RecordType>();
159
- if (!Ty) {
160
- if (AllowShortCircuit) return false ;
161
- AllMatches = false ;
162
- continue ;
163
- }
157
+ if (!Ty)
158
+ return false ;
164
159
165
160
CXXRecordDecl *Base =
166
161
cast_or_null<CXXRecordDecl>(Ty->getDecl ()->getDefinition ());
167
162
if (!Base ||
168
163
(Base->isDependentContext () &&
169
164
!Base->isCurrentInstantiation (Record))) {
170
- if (AllowShortCircuit) return false ;
171
- AllMatches = false ;
172
- continue ;
165
+ return false ;
173
166
}
174
167
175
168
Queue.push_back (Base);
176
- if (!BaseMatches (Base)) {
177
- if (AllowShortCircuit) return false ;
178
- AllMatches = false ;
179
- continue ;
180
- }
169
+ if (!BaseMatches (Base))
170
+ return false ;
181
171
}
182
172
183
173
if (Queue.empty ())
184
174
break ;
185
175
Record = Queue.pop_back_val (); // not actually a queue.
186
176
}
187
177
188
- return AllMatches ;
178
+ return true ;
189
179
}
190
180
191
181
bool CXXBasePaths::lookupInBases (ASTContext &Context,
You can’t perform that action at this time.
0 commit comments