[LLVMbugs] [Bug 17161] New: [-cxx-abi microsoft] Mangle declarations extern "C" functions when nested inside of namespaces properly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 8 21:04:27 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17161

            Bug ID: 17161
           Summary: [-cxx-abi microsoft] Mangle declarations extern "C"
                    functions when nested inside of namespaces properly
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
namespace test0 {
extern "C" inline void *fun0() {
  struct A;
  struct B {
    static void *fun() {
      static int A::* g;
      return (void *)&g;
    }
  };
  return B::fun();
};
void *h() { return fun0(); }
}

should be mangled as:
?g@?3??fun at B@?1??fun0@@9 at SAPEAXXZ@4PEQA@?1??3 at 9@HEQ4?1??3 at 9@


when PR17157 is fixed, we get:
?g@?3??fun at B@?1??fun0 at test0@@9 at SAPEAXXZ@4PEQA@?1??34 at 9@HEQ5?1??34 at 9@

Note how we mangle the "test0" into the name of the static. We should pretend
that extern "C" functions live at top-most scope in such cases.
Fun fact: This is not the case for template arguments where namespace scope
suddenly matters.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130909/23a1d7fa/attachment.html>


More information about the llvm-bugs mailing list