Skip to content

Debug information shows incorrect lexical scope for typedef. #44229

Open
@CarlosAlbertoEnciso

Description

@CarlosAlbertoEnciso
Bugzilla Link 44884
Version trunk
OS All
CC @dwblaikie,@gregbedwell,@JDevlieghere,@jmorse,@walkerkd,@OCHyams,@pogo59

Extended Description

Given the following test case:

//------------------------------------------------------------
// typedef.cpp
//------------------------------------------------------------

int bar(float Input) { return (int)Input; }

unsigned foo(char Param) {
typedef int INT;
INT Value = Param;
{
typedef float FLOAT;
{
FLOAT Added = Value + Param;
Value = bar(Added);
}
}
return Value + Param;
}

//------------------------------------------------------------

Using the following command line options to generate debug info
(DWARF) and (COFF):

clang -c -g -O0 typedef.cpp -o typedef.o
clang -c -g -O0 typedef.cpp -o typedef-coff.o -gcodeview --target=x86_64-windows

Looking at the output generated by llvm-dwarfdump and llvm-diva,
the debug info shows the typedefs 'INT'and 'FLOAT' to be at the same lexical scope (function scope).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions