llvm-project/lldb/unittests
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
..
Breakpoint
Core
DataFormatter
Disassembler
Editline
Expression
Host
Interpreter
Language
ObjectFile
Platform
Process
ScriptInterpreter
Signals
Symbol [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in Debug builds 2020-01-10 21:34:07 +01:00
SymbolFile [lldb] Remove default llvm::Triple argument from ClangASTContext constructor 2020-01-08 12:05:51 +01:00
Target
TestingSupport
UnwindAssembly
Utility RangeDataVector: Support custom sorting for D63540 2020-01-10 15:14:38 +01:00
debugserver
tools
CMakeLists.txt
gtest_common.h