[llvm-bugs] [Bug 26053] New: Pack expansion mangling inadequate: error: definition with same mangled name as another definition

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 6 16:19:49 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26053

            Bug ID: 26053
           Summary: Pack expansion mangling inadequate: error: definition
                    with same mangled name as another definition
           Product: clang
           Version: trunk
          Hardware: All
                OS: Linux
            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, llvm-bugs at lists.llvm.org
    Classification: Unclassified

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: http://melpon.org/wandbox/permlink/wza71mJ5R0feCcG5

### 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

-- 
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/20160107/8f7e3b6b/attachment-0001.html>


More information about the llvm-bugs mailing list