Skip to content

Clang doesn't define the typeinfo for _Float16 #77786

@ldionne

Description

@ldionne

When libc++ defines ~__fundamental_type_info(), Clang is supposed to emit the typeinfos for all fundamental types, which should include _Float16. But this doesn’t happen, as can be seen here: https://godbolt.org/z/EKTe8z3cf

Self-standing repro:

$ cat <<EOF | clang++ -xc++ - -c -o typeinfos.o && nm -omg typeinfos.o | c++filt | grep _Float16
namespace __cxxabiv1 {
    struct __fundamental_type_info {
        virtual ~__fundamental_type_info();
    };

    // This miraculously (compiler magic) emits the type_info's for:
    //   1. all of the fundamental types
    //   2. pointers to all of the fundamental types
    //   3. pointers to all of the const fundamental types
    __fundamental_type_info::~__fundamental_type_info()
    {
    }
}
EOF

Output is: nothing
Ouput should be: Something like

typeinfos.o: 0000000000000580 (__DATA,__const) external typeinfo for _Float16 const*
typeinfos.o: 0000000000000560 (__DATA,__const) external typeinfo for _Float16*
typeinfos.o: 0000000000000550 (__DATA,__const) external typeinfo for _Float16
typeinfos.o: 0000000000000927 (__TEXT,__const) external typeinfo name for _Float16 const*
typeinfos.o: 0000000000000924 (__TEXT,__const) external typeinfo name for _Float16*
typeinfos.o: 0000000000000922 (__TEXT,__const) external typeinfo name for _Float16

rdar://120819357

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions