<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 INVALID - Fails to deduce template type for repeated argument of the same type"
   href="https://bugs.llvm.org/show_bug.cgi?id=40302">bug 40302</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>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Fails to deduce template type for repeated argument of the same type"
   href="https://bugs.llvm.org/show_bug.cgi?id=40302#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Fails to deduce template type for repeated argument of the same type"
   href="https://bugs.llvm.org/show_bug.cgi?id=40302">bug 40302</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>That may be true, but this isn't the right forum to discuss that. You can force
a conversion from a non-capturing lambda to a function pointer / function
lvalue in a number of ways, including unary prefix operator + and operator *,
so there are at least simple workarounds:

auto fn = someBool ? +[](){return 1;} : +[](){return 2;}; // ok

Clang is following the standard C++ rules here, so I'm closing this bug. If you
want to discuss those rules further, this is not the appropriate place;
std-discussion and stackoverflow would be better forums.</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>