[PATCH] D56936: Fix handling of overriden methods during ASTImport
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 22 08:45:34 PST 2019
martong added inline comments.
================
Comment at: lib/AST/ASTImporter.cpp:3046
+ if (!D->doesThisDeclarationHaveABody())
+ return cast<Decl>(const_cast<FunctionDecl *>(FoundByLookup));
+ else {
----------------
balazske wrote:
> The `cast<Decl>` should not be needed here (and is not done at the other return places). The `const_cast` can be omitted too (`FoundByLookup` is not const now).
We must also register the decl into the map of imported decls as we do in all the other cases.
```
return Importer.MapImported(D, FoundByLookup);
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56936/new/
https://reviews.llvm.org/D56936
More information about the cfe-commits
mailing list