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: unassignedclangb...@nondot.org
          Reporter: hst...@ca.ibm.com
                CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to