teemperor marked an inline comment as done.
teemperor added inline comments.


================
Comment at: lldb/source/Symbol/ClangASTContext.cpp:1347
+  if (decl_ctx->isRecord())
+    func_tmpl_decl->setAccess(clang::AccessSpecifier::AS_public);
 
----------------
shafik wrote:
> Where is the method being added and why are we not setting the access there? 
> Are we creating it though `CreateFunctionTemplateDecl` should be be checking 
> the `DeclContext` there to see if it is a `RecordDecl`?
We actually don't add it anywhere but instead use an already created related 
FunctionDecl and set this FunctionTemplateDecl as its specialisation (see 
`lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:1216`).

We could also add the FunctionTemplateDecl to the DeclContext explicitly. That 
doesn't seem to break anything and seems consistent with the other functions 
for creating Decls. On the other hand I'm not sure if this is is some untested 
workaround for something.

But in any case, whatever we returned from this function (or whether it was 
added to the DeclContext) is in an invalid state that triggers an assert as 
soon as anyone calls getAccess on it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71909



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to