[llvm-bugs] [Bug 51911] New: parameter pack expansion incorrectly when there is default parameter during template specialization

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 20 05:32:21 PDT 2021


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

            Bug ID: 51911
           Summary: parameter pack expansion incorrectly when there is
                    default parameter during template specialization
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nickhuang99 at hotmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The following code should NOT be accepted because parameter pack should be just
"int*" without "double" which is considered as "Extra". 

template<class...Ts,class Extra, class First=char>
void foo(First, Extra, Ts...){}
template<>
void foo<int*,double>(char,double,int*,double){}


As a contrast, the following code is rejected which is wrong.

template<class...Ts,class Extra, class First=char>
void foo(First, Extra, Ts...){}
template<>
void foo<int*,double>(char,double,int*){}

-- 
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/20210920/5b316360/attachment-0001.html>


More information about the llvm-bugs mailing list