[llvm-bugs] [Bug 25910] New: clang allows two var definitions with the same mangled name

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 21 03:47:42 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25910

            Bug ID: 25910
           Summary: clang allows two var definitions with the same mangled
                    name
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andreybokhanko at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

clang allows two var definitions with the same mangled name; only one var is
emitted:

$ cat test.cpp
extern "C" {
  int _ZN2nm3abcE = 1;
}

namespace nm {
  float abc = 2;
}

float foo() {
  return _ZN2nm3abcE + nm::abc;
}

$ clang -emit-llvm -S -c test.cpp

[no errors printed]

$ cat test.ll
...
@_ZN2nm3abcE = global float 2.000000e+00, align 4

[int _ZN2nm3abcE definition is nowhere to be found]

Yours,
Andrey
=================
Software Engineer
Intel Compiler Team
Intel

-- 
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/20151221/12fb46eb/attachment.html>


More information about the llvm-bugs mailing list