[LLVMbugs] [Bug 16096] New: [microsoft] Arrays arguments in function pointer types mangled incorrectly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 21 13:20:25 PDT 2013


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

            Bug ID: 16096
           Summary: [microsoft] Arrays arguments in function pointer types
                    mangled incorrectly
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: reid.kleckner at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This code fails to mangle correctly:

typedef void (*ArrayFunPtr)(int d[1]);
ArrayFunPtr getArrayFunPtr() { return 0; }
// CHECK: "\01?getArrayFunPtr@@YAP6AXQAH at ZXZ"
// FOUND: "\01?getArrayFunPtr@@YAP6AXPAH at ZXZ"

undname for these two symbols shows:

Undecoration of :- "?getArrayFunPtr@@YAP6AXQAH at ZXZ"
is :- "void (__cdecl*__cdecl getArrayFunPtr(void))(int * const)"

Undecoration of :- "?getArrayFunPtr@@YAP6AXPAH at ZXZ"
is :- "void (__cdecl*__cdecl getArrayFunPtr(void))(int *)"

Note the missing "const" on the variant produced by clang.

There are two problems here:
1. we lose the array-ness in getArrayDecayedType(), which you can see with
-ast-dump
2. after hacking getArrayDecayedType() to return a const-qualified pointer,
clang loses the const somewhere else (canonicalization?)

-- 
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/20130521/96e0f830/attachment.html>


More information about the llvm-bugs mailing list