<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Pack expansion mangling inadequate: error: definition with same mangled name as another definition"
href="https://llvm.org/bugs/show_bug.cgi?id=26053">26053</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Pack expansion mangling inadequate: error: definition with same mangled name as another definition
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hstong@ca.ibm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>When a function parameter pack expands parameter packs of a member function
template alongside parameter packs of an enclosing context, the mangling used
(namely SUBSTPACK) is insufficient.
Online compiler: <a href="http://melpon.org/wandbox/permlink/wza71mJ5R0feCcG5">http://melpon.org/wandbox/permlink/wza71mJ5R0feCcG5</a>
### SOURCE (<stdin>):
template <typename> struct A;
template <typename ...> struct Tup;
template <typename ...T, typename ...U>
struct A<Tup<Tup<T ...>, Tup<U ...>>> {
template <typename ...TT> void foo(T (* ...fp[])(TT)) { }
template <typename ...TT> void foo(U (* ...fp[])(TT)) { }
};
int main(void) {
A<Tup<Tup<short>, Tup<wchar_t>>> a;
a.foo<int>(static_cast<short (**)(int)>(0));
a.foo<int>(static_cast<wchar_t (**)(int)>(0));
}
### COMPILER INVOCATION:
clang++ -x c++ -std=c++11 -
### ACTUAL OUTPUT:
<stdin>:7:35: error: definition with same mangled name as another definition
template <typename ...TT> void foo(U (* ...fp[])(TT)) { }
^
<stdin>:6:35: note: previous definition is here
template <typename ...TT> void foo(T (* ...fp[])(TT)) { }
^
1 error generated.
### EXPECTED OUTPUT:
(clean compile and link)
### COMPILER VERSION INFO:
clang version 3.8.0 (trunk 256937)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/llvm-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>