File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1204,13 +1204,22 @@ namespace Cpp {
12041204
12051205 TCppType_t GetVariableType (TCppScope_t var)
12061206 {
1207- auto D = (Decl *) var;
1207+ auto D = (Decl *) var;
12081208
1209- if (auto DD = llvm::dyn_cast_or_null<DeclaratorDecl>(D)) {
1210- return DD->getType ().getAsOpaquePtr ();
1211- }
1209+ if (auto DD = llvm::dyn_cast_or_null<DeclaratorDecl>(D)) {
1210+ QualType QT = DD->getType ();
12121211
1213- return 0 ;
1212+ // Check if the type is a typedef type
1213+ if (QT->isTypedefNameType ()) {
1214+ return QT.getAsOpaquePtr ();
1215+ }
1216+
1217+ // Else, return the canonical type
1218+ QT = QT.getCanonicalType ();
1219+ return QT.getAsOpaquePtr ();
1220+ }
1221+
1222+ return 0 ;
12141223 }
12151224
12161225 intptr_t GetVariableOffset (compat::Interpreter& I, Decl* D) {
Original file line number Diff line number Diff line change 66#include " clang/Sema/Sema.h"
77
88#include " gtest/gtest.h"
9+ #include < string>
910
1011using namespace TestUtils ;
1112using namespace llvm ;
You can’t perform that action at this time.
0 commit comments