File tree Expand file tree Collapse file tree 3 files changed +0
-32
lines changed
test/API/lang/cpp/dereferencing_references Expand file tree Collapse file tree 3 files changed +0
-32
lines changed Original file line number Diff line number Diff line change @@ -2907,15 +2907,6 @@ ValueObjectSP ValueObject::AddressOf(Status &error) {
2907
2907
2908
2908
AddressType address_type = eAddressTypeInvalid;
2909
2909
const bool scalar_is_load_address = false ;
2910
-
2911
- // For reference type we need to get the address of the object that
2912
- // it refers to.
2913
- if (GetCompilerType ().IsReferenceType ()) {
2914
- ValueObjectSP deref_obj = Dereference (error);
2915
- if (error.Fail () || !deref_obj)
2916
- return ValueObjectSP ();
2917
- return deref_obj->AddressOf (error);
2918
- }
2919
2910
addr_t addr = GetAddressOf (scalar_is_load_address, &address_type);
2920
2911
error.Clear ();
2921
2912
if (addr != LLDB_INVALID_ADDRESS && address_type != eAddressTypeHost) {
Original file line number Diff line number Diff line change @@ -25,24 +25,3 @@ def test(self):
25
25
# Typedef to a reference should dereference to the underlying type.
26
26
td_val = self .expect_var_path ("td_to_ref_type" , type = "td_int_ref" )
27
27
self .assertEqual (td_val .Dereference ().GetType ().GetName (), "int" )
28
-
29
- def test_take_address_of_reference (self ):
30
- """Tests taking address of lvalue/rvalue references in lldb works correctly."""
31
- self .build ()
32
- lldbutil .run_to_source_breakpoint (
33
- self , "// break here" , lldb .SBFileSpec ("main.cpp" )
34
- )
35
-
36
- plref_val_from_code = self .expect_var_path ("pl_ref" , type = "TTT *" )
37
- plref_val_from_expr_path = self .expect_var_path ("&l_ref" , type = "TTT *" )
38
- self .assertEqual (
39
- plref_val_from_code .GetValueAsAddress (),
40
- plref_val_from_expr_path .GetValueAsAddress (),
41
- )
42
-
43
- prref_val_from_code = self .expect_var_path ("pr_ref" , type = "TTT *" )
44
- prref_val_from_expr_path = self .expect_var_path ("&r_ref" , type = "TTT *" )
45
- self .assertEqual (
46
- prref_val_from_code .GetValueAsAddress (),
47
- prref_val_from_expr_path .GetValueAsAddress (),
48
- )
Original file line number Diff line number Diff line change @@ -9,7 +9,5 @@ int main() {
9
9
// typedef of a reference
10
10
td_int_ref td_to_ref_type = i;
11
11
12
- TTT *pl_ref = &l_ref;
13
- TTT *pr_ref = &r_ref;
14
12
return l_ref; // break here
15
13
}
You can’t perform that action at this time.
0 commit comments