llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.12k stars 12.01k forks source link

clang: undefined reference to `typeinfo for half' #94677

Open jroelofs opened 5 months ago

jroelofs commented 5 months ago
#include <typeinfo>
#include <cstdio>

int main() {
    printf("%s\n", typeid(__fp16).name());
}

https://clang.godbolt.org/z/9Tzaahx4q

jroelofs commented 5 months ago

I believe the problem is that TypeInfoIsInStandardLibrary and ItaniumCXXABI::EmitFundamentalRTTIDescriptors don't agree. Which one is correct?

jroelofs commented 5 months ago

cc @sjoerdmeijer @majnemer @zygoloid

llvmbot commented 5 months ago

@llvm/issue-subscribers-c-1

Author: Jon Roelofs (jroelofs)

``` #include <typeinfo> #include <cstdio> int main() { printf("%s\n", typeid(__fp16).name()); } ``` https://clang.godbolt.org/z/9Tzaahx4q
zygoloid commented 5 months ago

Oops, looks like we missed this comment when authoring / reviewing the patch.

jroelofs commented 5 months ago

Yep. We should probably enforce that with an assertion on both ends.