Files
clang-p2996/lldb/test/API/functionalities/completion/main.cpp
Sudharsan Veeravalli de5518836e [LLDB] Fix crash when using tab completion on class variables (#83234)
We weren't checking to see if the partial_path was empty before adding
completions and this led to crashes when the class object and a variable
both start with the same substring.

Fixes [#81536](https://github.com/llvm/llvm-project/issues/81536)

---------

Co-authored-by: Michael Buch <michaelbuch12@gmail.com>
2024-02-29 09:40:27 +00:00

34 lines
517 B
C++

#include <iostream>
class Baz {
public:
int x;
};
class Foo
{
public:
Baz t;
int temp;
int Bar(int x, int y) { return x + y; }
};
namespace { int Quux (void) { return 0; } }
struct Container { int MemberVar; };
int main(int argc, char *argv[]) {
if (argc > 1 && std::string(argv[1]) == "-x")
std::cin.get();
Foo fooo;
Foo *ptr_fooo = &fooo;
fooo.Bar(1, 2);
Container container;
Container *ptr_container = &container;
int q = Quux();
return container.MemberVar = 3; // Break here
}