File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
source/Plugins/TypeSystem/Clang
test/API/lang/cpp/dereferencing_references Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -6500,7 +6500,8 @@ CompilerType TypeSystemClang::GetChildCompilerTypeAtIndex(
6500
6500
case clang::Type::RValueReference:
6501
6501
if (idx_is_valid) {
6502
6502
const clang::ReferenceType *reference_type =
6503
- llvm::cast<clang::ReferenceType>(GetQualType (type).getTypePtr ());
6503
+ llvm::cast<clang::ReferenceType>(
6504
+ RemoveWrappingTypes (GetQualType (type)).getTypePtr ());
6504
6505
CompilerType pointee_clang_type =
6505
6506
GetType (reference_type->getPointeeType ());
6506
6507
if (transparent_pointers && pointee_clang_type.IsAggregateType ()) {
Original file line number Diff line number Diff line change @@ -21,3 +21,7 @@ def test(self):
21
21
# Same as above for rvalue references.
22
22
rref_val = self .expect_var_path ("r_ref" , type = "TTT &&" )
23
23
self .assertEqual (rref_val .Dereference ().GetType ().GetName (), "TTT" )
24
+
25
+ # Typedef to a reference should dereference to the underlying type.
26
+ td_val = self .expect_var_path ("td_to_ref_type" , type = "td_int_ref" )
27
+ self .assertEqual (td_val .Dereference ().GetType ().GetName (), "int" )
Original file line number Diff line number Diff line change 1
1
typedef int TTT;
2
+ typedef int &td_int_ref;
2
3
3
4
int main () {
4
5
int i = 0 ;
6
+ // references to typedefs
5
7
TTT &l_ref = i;
6
8
TTT &&r_ref = static_cast <TTT &&>(i);
9
+ // typedef of a reference
10
+ td_int_ref td_to_ref_type = i;
11
+
7
12
return l_ref; // break here
8
13
}
You can’t perform that action at this time.
0 commit comments