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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
This code fails to mangle correctly:
typedef void (*ArrayFunPtr)(int d[1]);
ArrayFunPtr getArrayFunPtr() { return 0; }
// CHECK: "\01?getArrayFunPtr@@YAP6AXQAH@ZXZ"
// FOUND: "\01?getArrayFunPtr@@YAP6AXPAH@ZXZ"
undname for these two symbols shows:
Undecoration of :- "?getArrayFunPtr@@YAP6AXQAH@ZXZ"
is :- "void (__cdecl*__cdecl getArrayFunPtr(void))(int * const)"
Undecoration of :- "?getArrayFunPtr@@YAP6AXPAH@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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs