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

Congcong Cai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 25 11:36:43 PDT 2023


HerrCai0907 added inline comments.


================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:969
             << (int)DFK.asComparison()
-            << Context.getTagDeclType(
-                   cast<CXXRecordDecl>(FD->getLexicalDeclContext()));
+            << Context.getRecordType(RecordType->getAsRecordDecl());
       }
----------------
erichkeane wrote:
> 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.  
I am not very familiar with QualType's conversion. Do you think it is the correct path to remove all qualifier and get the full name for class?


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