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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to