Files
clang-p2996/lldb/test/API/lang/cpp/dereferencing_references/main.cpp
Andy Yankovsky 95102b7dc3 [lldb] Unwrap the type when dereferencing the value
The value type can be a typedef of a reference (e.g. `typedef int& myint`).
In this case `GetQualType(type)` will return `clang::Typedef`, which cannot
be casted to `clang::ReferenceType`.

Fix a regression introduced in https://reviews.llvm.org/D103532.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D113673
2021-11-15 14:48:19 +01:00

14 lines
249 B
C++

typedef int TTT;
typedef int &td_int_ref;
int main() {
int i = 0;
// references to typedefs
TTT &l_ref = i;
TTT &&r_ref = static_cast<TTT &&>(i);
// typedef of a reference
td_int_ref td_to_ref_type = i;
return l_ref; // break here
}