<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW " title="NEW --- - lldb incorrectly displays typedefs in different lexical scopes" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24074&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=zvVHzKuF4aDmLC0H2cts2V7z3VzSER05A9GEsZs0WK0&s=lZLoL7PAA9b6fDhFlBPD8Dd4lPB6MOug-KrlT1hg8QM&e=">24074</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lldb incorrectly displays typedefs in different lexical scopes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>varvara.rainchik@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>cat test.c
int main( void ) {
    int c = 0;
    while (c <= 1) {
        if (c != 1) {
            typedef int a;
            a b;
            b = 0;
        } else {
            typedef float a;
            a b;
            b = 0;
        }
        c++;
    }  
    return 0;
}

I'm compiling this test with icc:
icc -c -g -O0 test.c
icc -o test.exe -O0 -g test.o

I see that icc generates correct debug info: each typedef goes to its own
lexical scope.
dwarfdump test.o
...
0x000000e7:         TAG_lexical_block [5] *
                     AT_decl_line( 4 )
                     AT_decl_file( "/Applications/test/test.c" )
                     AT_low_pc( 0x000000000000001f )
                     AT_high_pc( 0x0000000000000028 )

0x000000fa:             TAG_variable [4]
                         AT_decl_line( 6 )
                         AT_decl_file( "/Applications/test/test.c" )
                         AT_name( "b" )
                         AT_type( {0x00000106} ( a ) )
                         AT_location( rbp-12 )

0x00000106:             TAG_typedef [6]
                         AT_decl_line( 5 )
                         AT_decl_file( "/Applications/test/test.c" )
                         AT_name( "a" )
                         AT_type( {0x000000b6} ( int ) )

0x0000010f:             NULL

0x00000110:         TAG_lexical_block [5] *
                     AT_decl_line( 8 )
                     AT_decl_file( "/Applications/test/test.c" )
                     AT_low_pc( 0x0000000000000028 )
                     AT_high_pc( 0x0000000000000030 )

0x00000123:             TAG_variable [4]
                         AT_decl_line( 10 )
                         AT_decl_file( "/Applications/test/test.c" )
                         AT_name( "b" )
                         AT_type( {0x0000012f} ( a ) )
                         AT_location( rbp-8 )

0x0000012f:             TAG_typedef [6]
                         AT_decl_line( 9 )
                         AT_decl_file( "/Applications/test/test.c" )
                         AT_name( "a" )
                         AT_type( {0x0000013a} ( float ) )

0x00000138:             NULL


But, lldb displays wrong type for second typedef:

lldb test.exe
(lldb) target create "test.exe"
Current executable set to 'test.exe' (x86_64).
(lldb) b 7
Breakpoint 1: where = test.exe`main + 31 at test.c:7, address =
0x0000000100000f97
(lldb) b 11
Breakpoint 2: where = test.exe`main + 40 at test.c:11, address =
0x0000000100000fa0
(lldb) r
Process 3620 launched: '/Applications/test/test.exe' (x86_64)
Process 3620 stopped
* thread #1: tid = 0xed87, 0x0000000100000f97 test.exe`main + 31 at test.c:7,
queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f97 test.exe`main + 31 at test.c:7
   4               if (c != 1) {
   5                   typedef int a;
   6                   a b;
-> 7                   b = 0;
   8               } else {
   9                   typedef float a;
   10                  a b;
(lldb) type lookup a
Best match found in /Applications/test/test.exe:
id = {0x100000106}, name = "a", byte-size = 4, decl = test.c:5, clang_type =
"typedef a"
     typedef 'a': id = {0x1000000b6}, name = "int", byte-size = 4, clang_type =
"int"

(lldb) c
Process 3620 resuming
Process 3620 stopped
* thread #1: tid = 0xed87, 0x0000000100000fa0 test.exe`main + 40 at test.c:11,
queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
    frame #0: 0x0000000100000fa0 test.exe`main + 40 at test.c:11
   8               } else {
   9                   typedef float a;
   10                  a b;
-> 11                  b = 0;
   12              }
   13              c++;
   14          }  
(lldb) type lookup a
Best match found in /Applications/test/test.exe:
id = {0x100000106}, name = "a", byte-size = 4, decl = test.c:5, clang_type =
"typedef a"
     typedef 'a': id = {0x1000000b6}, name = "int", byte-size = 4, clang_type =
"int"</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>