llvm-project/lldb/unittests/Symbol
Raphael Isemann 9e13cff44d [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in Debug builds
Summary:
In Debug builds we call VerifyDecl in ClangASTContext::CreateFunctionDeclaration which in turn
calls `getAccess` on the created FunctionDecl. As we passed in a RecordDecl as the DeclContext
for the FunctionDecl, we end up hitting the assert in `getAccess` that checks that we never have
a Decl inside a Record without a valid AccessSpecifier. FunctionDecls are never in RecordDecls
(that would be a CXXMethodDecl) so setting a access specifier would not be the correct way to
fix this.

Instead this patch does the same thing that DWARFASTParserClang::ParseSubroutine is doing:
We pass in the FunctionDecl with the TranslationUnit as the DeclContext. That's not ideal but
it is how we currently do it when creating our debug info AST, so the unit test should do
the same.

Reviewers: shafik

Reviewed By: shafik

Subscribers: aprantl, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D72359
2020-01-10 21:34:07 +01:00
..
Inputs unittests: Use yaml2obj as a library instead of an external process 2019-08-20 12:28:36 +00:00
CMakeLists.txt [lldb] Add unit test for ClangASTImporter 2019-12-16 12:43:55 +01:00
LocateSymbolFileTest.cpp [lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests 2019-12-23 10:38:25 +01:00
PostfixExpressionTest.cpp Fix windows build after r369894 2019-08-26 12:42:32 +00:00
TestClangASTContext.cpp [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in Debug builds 2020-01-10 21:34:07 +01:00
TestClangASTImporter.cpp [lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests 2019-12-23 10:38:25 +01:00
TestDWARFCallFrameInfo.cpp [lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests 2019-12-23 10:38:25 +01:00
TestLineEntry.cpp [lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests 2019-12-23 10:38:25 +01:00
TestType.cpp Generalize FindTypes with CompilerContext to support fuzzy lookup 2019-08-21 18:06:56 +00:00