Commit 76bf57c
committed
Look for element_type typedef in base classes (#85)
For the yes1 variable from the test_smart_pointer test, we get
- with llvm/clang on mac:
<Variable id="_1012" name="yes1" type="_1554" init="new int{6}" context="_1" location="f118:11" file="f118" line="11" mangled="_Z4yes1"/>
<Class id="_1554" name="shared_ptr<int>" context="_7" location="f46:3868" file="f46" line="3868" members="_7239 _7240 _7241 _7242 _7243 _7244 _7245 _7246 _7247 _7248 _7249 _7250 _7251 _7252 _7253 _7254 _7255 _7256 _7257 _7258 _7259" befriending="" size="128" align="64"/>
<Typedef id="_7239" name="element_type" type="_2541" context="_1554" access="public" location="f46:3871" file="f46" line="3871"/>
- with gcc on Linux:
<Variable id="_977" name="yes1" type="_1024" init="new int{6}" context="_1" location="f44:11" file="f44" line="11" mangled="_Z4yes1"/>
<Class id="_1024" name="shared_ptr<int>" context="_7" location="f51:93" file="f51" line="93" members="_3644 _3645 _3646 _3647 _3648 _3649 _3650" bases="_1039" befriending="_1025" size="128" align="64">
<Base type="_1039" access="public" virtual="0" offset="0"/>
</Class>
<Class id="_1039" name="__shared_ptr<int, __gnu_cxx::_Lock_policy::_S_atomic>" context="_7" location="f42:867" file="f42" line="867" members="_3711 _3712 _3713 _3714 _3715 _3716 _3717 _3718 _3719 _3720 _3721 _3722 _3723 _3724 _3725 _3726 _3727 _3728 _3729 _3730 _3731" befriending="_1040" size="128" align="64"/>
<Typedef id="_3711" name="element_type" type="_3121" context="_1039" access="public" location="f42:874" file="f42" line="874"/>
In the second case, we need to loop over the base class
and check the members of that class. The member _3711
is the one we are looking for. Without this change the value_type
methods were not able to find the typedef.1 parent 6a0bf82 commit 76bf57c
1 file changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
106 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
0 commit comments