File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -146,12 +146,13 @@ void ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit() {
146
146
}
147
147
// Check if a definition in another namespace exists.
148
148
const auto DeclName = CurDecl->getName ();
149
- if (!DeclNameToDefinitions.contains (DeclName)) {
149
+ auto It = DeclNameToDefinitions.find (DeclName);
150
+ if (It == DeclNameToDefinitions.end ()) {
150
151
continue ; // No definition in this translation unit, we can skip it.
151
152
}
152
153
// Make a warning for each definition with the same name (in other
153
154
// namespaces).
154
- const auto &Definitions = DeclNameToDefinitions[DeclName] ;
155
+ const auto &Definitions = It-> second ;
155
156
for (const auto *Def : Definitions) {
156
157
diag (CurDecl->getLocation (),
157
158
" no definition found for %0, but a definition with "
You can’t perform that action at this time.
0 commit comments