llvm-project/lldb
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
..
bindings [lldb/Lua] Add lua typemaps for INOUT params 2020-01-09 14:51:13 -08:00
cmake [lldb/CMake] Only auto-enable Lua when SWIG is found 2020-01-08 14:02:47 -08:00
docs [lldb/Bindings] Move bindings into their own subdirectory 2020-01-09 08:44:34 -08:00
examples [Examples] Move structured-data unpacking out of the loop. (NFC) 2019-11-22 15:43:39 -08:00
include/lldb RangeDataVector: Support custom sorting for D63540 2020-01-10 15:14:38 +01:00
packages/Python/lldbsuite [lldb][tests] Make it possible to expect failure for a whole category 2020-01-10 17:37:55 +03:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts [lldb/Bindings] Move bindings into their own subdirectory 2020-01-09 08:44:34 -08:00
source [lldb] Make CompleteTagDeclsScope completion order deterministic 2020-01-10 21:19:04 +01:00
test [lldb/Lua] Support loading Lua modules 2020-01-10 10:22:30 -08:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools Save more descriptive error msg from FBS/BKS, relay it up to lldb. 2020-01-08 18:47:35 -08:00
unittests [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in Debug builds 2020-01-10 21:34:07 +01:00
utils [lldb] Respect previously set values of LLDB_TABLEGEN_EXE 2019-12-16 14:31:42 -08:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [lldb/Bindings] Move bindings into their own subdirectory 2020-01-09 08:44:34 -08:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py