<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Clang++ errors when using va_start in a lambda with variadic arguments"
   href="http://llvm.org/bugs/show_bug.cgi?id=19617">19617</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang++ errors when using va_start in a lambda with variadic arguments
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>felixcca@yahoo.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12461" name="attach_12461" title="Program that causes the issue described in this ticket">attachment 12461</a> <a href="attachment.cgi?id=12461&action=edit" title="Program that causes the issue described in this ticket">[details]</a></span>
Program that causes the issue described in this ticket

# Overview

Clang will error out if `va_start` is used from a lambda with C-style variadic
arguments, unless the parent function also has variadic arguments.

# Steps to reproduce

Compile attached file.

# Expected result

Program should (probably?) compile and return 88 on execution.

# Actual result

Clang errors out:

    test.cpp:8:3: error: 'va_start' used in function with fixed args
                va_start(ap, a);

# Additional information

I'm not a language lawyer, so I'm not sure if lambdas with variadic arguments
are allowed. However, I'm pretty confident that either lambdas with variadic
arguments should always cause an error (including when the parent function also
has variadic parameters), or that they should work on their own.

g++ 4.8.1 seems to accept lambdas with variadic arguments (or at least accepts
the attached program).</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>