[PATCH] D62064: [ASTImporter] Fix unhandled cases in ASTImporterLookupTable

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 26 10:11:28 PDT 2019


a_sidorin accepted this revision.
a_sidorin added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:4259
 static const RecordDecl * getRecordDeclOfFriend(FriendDecl *FD) {
   QualType Ty = FD->getFriendType()->getType();
+  if (auto *Inner = dyn_cast<TypedefType>(Ty.getTypePtr())) {
----------------
martong wrote:
> a_sidorin wrote:
> > Will getCanonicalType() do the job?
> That's a good catch! Thank you for pointing out.
Can we replace the whole function with:
```
QualType Ty = FD->getFriendType()->getType().getCanonicalType();
return cast<RecordType>(Ty)->getDecl();
```
?


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:4249
 
 static const RecordDecl * getRecordDeclOfFriend(FriendDecl *FD) {
   QualType Ty = FD->getFriendType()->getType();
----------------
Redundant space after '*'.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62064/new/

https://reviews.llvm.org/D62064





More information about the cfe-commits mailing list