[PATCH] D151365: [Sema] cast to CXXRecordDecl correctly when diag a default comparison method

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 25 07:00:22 PDT 2023


erichkeane added inline comments.


================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:969
             << (int)DFK.asComparison()
-            << Context.getTagDeclType(
-                   cast<CXXRecordDecl>(FD->getLexicalDeclContext()));
+            << Context.getRecordType(RecordType->getAsRecordDecl());
       }
----------------
What is going on here?  You already have the `RecordType` in the RecordType variable.  You don't need to go to RecordDecl and back?  You should just be able to put the `RecordType` variable directly.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151365



More information about the cfe-commits mailing list