From 7ead00872929a994ac40fc2c99fce15968e2c5a6 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Thu, 2 Jan 2020 14:46:39 +0100 Subject: [lldb] Fix crash in AccessDeclContextSanity when copying FunctionTemplateDecl inside a record. Summary: We currently don't set access specifiers for function template declarations. This seems to be fine as long as the function template is not declared inside any record in which case Clang asserts with the following once we try to query it's access: ``` Assertion failed: (Access != AS_none && "Access specifier is AS_none inside a record decl"), function AccessDeclContextSanity, ``` This patch just marks these function template declarations as public to make Clang happy. Reviewers: shafik, teemperor Reviewed By: teemperor Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71909 --- .../expression/completion-crash2/TestCompletionCrash2.py | 4 ---- .../test/commands/expression/completion-crash2/main.cpp | 11 ----------- .../TestRegressionAccessFunctionTemplateInRecord.py | 4 ++++ .../regression-access-function-template-in-record/main.cpp | 11 +++++++++++ 4 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/TestCompletionCrash2.py delete mode 100644 lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/main.cpp create mode 100644 lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/TestRegressionAccessFunctionTemplateInRecord.py create mode 100644 lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/main.cpp (limited to 'lldb/packages/Python/lldbsuite/test/commands') diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/TestCompletionCrash2.py b/lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/TestCompletionCrash2.py deleted file mode 100644 index 922347aa781..00000000000 --- a/lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/TestCompletionCrash2.py +++ /dev/null @@ -1,4 +0,0 @@ -from lldbsuite.test import lldbinline -from lldbsuite.test import decorators - -lldbinline.MakeInlineTest(__file__, globals(), [decorators.skipIf(bugnumber="rdar://53754063")]) diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/main.cpp b/lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/main.cpp deleted file mode 100644 index 02f15c295c2..00000000000 --- a/lldb/packages/Python/lldbsuite/test/commands/expression/completion-crash2/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -namespace n { -template class a {}; -template struct shared_ptr { - template - static void make_shared() { //%self.dbg.GetCommandInterpreter().HandleCompletion("e ", len("e "), 0, -1, lldb.SBStringList()) - typedef a c; - c d; - } -}; -} // namespace n -int main() { n::shared_ptr::make_shared(); } diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/TestRegressionAccessFunctionTemplateInRecord.py b/lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/TestRegressionAccessFunctionTemplateInRecord.py new file mode 100644 index 00000000000..f08c0dcbda9 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/TestRegressionAccessFunctionTemplateInRecord.py @@ -0,0 +1,4 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest(__file__, globals(), []) diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/main.cpp b/lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/main.cpp new file mode 100644 index 00000000000..02f15c295c2 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/regression-access-function-template-in-record/main.cpp @@ -0,0 +1,11 @@ +namespace n { +template class a {}; +template struct shared_ptr { + template + static void make_shared() { //%self.dbg.GetCommandInterpreter().HandleCompletion("e ", len("e "), 0, -1, lldb.SBStringList()) + typedef a c; + c d; + } +}; +} // namespace n +int main() { n::shared_ptr::make_shared(); } -- cgit v1.2.3