Skip to content

Commit 789e38e

Browse files
committed
[lldb][AST] fix declaration context passed to parameter vars
It needs to be the function declaration that the parameter belongs to, not the context of that function.
1 parent 649ba4c commit 789e38e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
9898
for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex) {
9999
QualType arg_qual_type(func_proto_type->getParamType(ArgIndex));
100100

101-
parm_var_decls.push_back(
102-
ParmVarDecl::Create(ast, const_cast<DeclContext *>(context),
103-
SourceLocation(), SourceLocation(), nullptr,
104-
arg_qual_type, nullptr, SC_Static, nullptr));
101+
parm_var_decls.push_back(ParmVarDecl::Create(
102+
ast, func_decl, SourceLocation(), SourceLocation(), nullptr,
103+
arg_qual_type, nullptr, SC_Static, nullptr));
105104
}
106105

107106
func_decl->setParams(ArrayRef<ParmVarDecl *>(parm_var_decls));

0 commit comments

Comments
 (0)