[LLVMbugs] [Bug 17141] New: Mangling of nullptr_t values do not follow ABI

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 6 19:13:17 PDT 2013


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

            Bug ID: 17141
           Summary: Mangling of nullptr_t values do not follow ABI
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The C++ ABI document (available at
http://mentorembedded.github.io/cxx-abi/abi.html#mangle.expr-primary) specifies
a mangling for the nullptr literal.
The mangling that Clang produces is not consistent with the form specified by
the ABI; namely, "LDn0E" is generated by Clang instead of "LDnE".

ICC mangles using the ABI-specified form: "LDnE".

Note that nullptr_t is not an integer type. It is contrary to the specification
to apply the production for integer literals to a literal of type nullptr_t.

### SMALL SOURCE (nullptrValueMangle.cc):
typedef decltype(nullptr) NullPtrType;
template <NullPtrType> void foo();
template <> void foo<nullptr>() { }

### ACTUAL MANGLED NAME:
> clang++ -std='c++11' -c -o nullptrValueMangle.o nullptrValueMangle.cc && nm nullptrValueMangle.o
00000000 b .bss
00000000 d .data
00000000 t .text
00000000 T __Z3fooILDn0EEvv

### EXPECTED MANGLED NAME:
__Z3fooILDnEEvv

### clang++ -v:
> clang++ -v
clang version 3.2 (trunk 158227)
Target: i386-pc-cygwin
Thread model: posix

-- 
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/20130907/e79c4915/attachment.html>


More information about the llvm-bugs mailing list