<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Clang++ accepts invalid template code"
   href="https://bugs.llvm.org/show_bug.cgi?id=44034">bug 44034</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WONTFIX
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Clang++ accepts invalid template code"
   href="https://bugs.llvm.org/show_bug.cgi?id=44034#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Clang++ accepts invalid template code"
   href="https://bugs.llvm.org/show_bug.cgi?id=44034">bug 44034</a>
              from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
        <pre>Well, the intent is that you are allowed to pass Args as explicit template
arguments:

  algorithm_impl::do_n<Function, Args...>(
                       std::forward<Function>(func),
                       std::forward<Args>(args)...,
                       std::make_integer_sequence<size_t, count>{});

... and in the case where Args is empty, you can instead write that as:

  algorithm_impl::do_n<Function>(
                       std::forward<Function>(func),
                       std::forward<Args>(args)...,
                       std::make_integer_sequence<size_t, count>{});

(This specifies Args as an empty pack.)

You can also omit the "Function" in this case, because it's deducible:

  algorithm_impl::do_n<>(
                       std::forward<Function>(func),
                       std::forward<Args>(args)...,
                       std::make_integer_sequence<size_t, count>{});

(This still -- presumably! -- specifies Args as an empty pack.)

And finally, [temp.arg.explicit]p4 says you can omit the empty <> in this case
and it means the same thing as including an <>:

  algorithm_impl::do_n(std::forward<Function>(func),
                       std::forward<Args>(args)...,
                       std::make_integer_sequence<size_t, count>{});

... so by that argument, the code is valid, and MSVC is wrong to reject it, and
Clang and GCC are correct to accept.

This whole area of the C++ standard is underspecified and imprecise, but the
behavior of Clang and GCC here is consistent, reasonable, and in line with
discussions on the C++ committee reflectors about how deduction should work.

MSVC rejects all of the above cases, so I think this is just an MSVC bug. (ICC
has even weirder behavior: it accepts the first two examples but rejects the
last two.)

We're unlikely to make any changes here unless the C++ standard text is
clarified to indicate Clang's behavior is incorrect, so I'm resolving WONTFIX
for now.</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>