Skip to content

Commit 019936b

Browse files
authored
Merge pull request #523 from Teemperor/FixCrashAccessFunctionTemplateMaster
[lldb] Fix crash in AccessDeclContextSanity when copying FunctionTemp…
2 parents c3e5ae3 + d16d371 commit 019936b

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/TestCompletionCrash2.py

Lines changed: 0 additions & 4 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from lldbsuite.test import lldbinline
2+
from lldbsuite.test import decorators
3+
4+
lldbinline.MakeInlineTest(__file__, globals(), [])

lldb/source/Symbol/ClangASTContext.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,11 @@ clang::FunctionTemplateDecl *ClangASTContext::CreateFunctionTemplateDecl(
15471547
// TODO: verify which decl context we should put template_param_decls into..
15481548
template_param_decls[i]->setDeclContext(func_decl);
15491549
}
1550+
// Function templates inside a record need to have an access specifier.
1551+
// It doesn't matter what access specifier we give the template as LLDB
1552+
// anyway allows accessing everything inside a record.
1553+
if (decl_ctx->isRecord())
1554+
func_tmpl_decl->setAccess(clang::AccessSpecifier::AS_public);
15501555

15511556
return func_tmpl_decl;
15521557
}

0 commit comments

Comments
 (0)