[LLVMbugs] [Bug 18131] New: [-cxx-abi microsoft] Mangle identifier name collisions with additional context

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 4 03:22:59 PST 2013


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

            Bug ID: 18131
           Summary: [-cxx-abi microsoft] Mangle identifier name collisions
                    with additional context
           Product: clang
           Version: unspecified
          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:

inline int func(bool f) {
  if (f) {
    static int i;
    i++;
    return i;
  }
  static int i;
  i++;
  return i;
}

int call(bool f) {
  return func(f);
}

MSVC does something unworkable, both 'i' declarations have the same external
name.

They assign them both:
?i@?4??func@@YAH_N at Z@4HA

I believe we can do the following instead:
first 'i' gets: ?i@?4??func@@YAH_N at Z@4HA
second 'i' gets: ?i@?0?4??func@@YAH_N at Z@4HA

This has the advantage of demangling to something that makes sense while _also_
ensuring that we don't collide with anything else.

-- 
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/20131204/9c91204b/attachment.html>


More information about the llvm-bugs mailing list