<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57608>57608</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang++ doesnt add debuginfo about access level of typedefs in classes
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          billionai
      </td>
    </tr>
</table>

<pre>
    when compiling a program such as

```
class c{
public:
    typedef double public_double;
    c(double dd) : d(dd) { }
private:
    public_double d;
};

int main(){
    c tmp(1);
    c::public_double dob = 0;
    return (int)dob;
}
```

clang can correctly identify the access level, but when analysing the class using `readelf -w` we find the following debug information for the typedef:

 <1><3e>: Abbrev Number: 5 (DW_TAG_typedef)
    <3f>   DW_AT_type        : <0x57>
    <43>   DW_AT_name        : (indexed string: 0x6): public_double
    <44>   DW_AT_decl_file   : 0
    <45>   DW_AT_decl_line   : 3

While g++ gives the following debuginfo:

 <2><53>: Abbrev Number: 8 (DW_TAG_typedef)
    <54>   DW_AT_name        : (indirect string, offset: 0x62): public_double
    <58>   DW_AT_decl_file   : 1
    <59>   DW_AT_decl_line   : 3
    <5a>   DW_AT_decl_column : 20
    <5b>   DW_AT_type        : <0x77>
    <5f>   DW_AT_accessibility: 1       (public)

The lack of DW_AT_accessibility means that GDB is unable to fully understand the class, and ptype can't inform the user about access levels of the typedef.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVcuS2joQ_Rp70xVKyA9g4QWEJLuspirLKVlqg-6VbUqSYfj7tGTD4Ay5cyljW9LR6dbph-teXavLETuQfXvSRncHEHCy_cGKFtwgjyBcwvYJ2073kk1XHEojnAOZrHbj-DTURsskm9BAP389ocIGVE9rCCPidRwl2e4dKBO-nkBKJXwDRAMqTI6j1Y7--8mO1WfhcWZoxkwbb9xh0_093nXnoRW6I25ivjsfnQDfnmh-G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