https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71199

--- Comment #5 from Yu Xuanchi <yuxuanchiadm at 126 dot com> ---
So there is a problem clang does not support nested function. Like:
-
void foo() {
  void foo1() {
    // Bar
  }
}
-
And cpp also not supported. But gcc support it as an extensions. So how we deal
with code like this:
-
void __attribute__((overloadable)) test(long bar) {}
void foo1() {
  void __attribute__((overloadable)) test(int bar) {}
  void __attribute__((overloadable)) test(float bar) {}
}
void foo2() {
  void __attribute__((overloadable)) test(int bar) {}
  void __attribute__((overloadable)) test(float bar) {}
}
-
So extern scope "test" function should be mangled to "_Z4testl" right? But how
about others? Should we reject compile code like this? Or just allow it and
mangle it in some way? The origin gcc mangle nested function linke "test.0000".
the 0000 is some number only gcc what it mean. So should we mangle name like
"Z4testi.0000"? or "Z9test.0000i"?

Reply via email to