[LLVMbugs] [Bug 19617] New: Clang++ errors when using va_start in a lambda with variadic arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 30 11:10:21 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19617

            Bug ID: 19617
           Summary: Clang++ errors when using va_start in a lambda with
                    variadic arguments
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: felixcca at yahoo.ca
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12461
  --> http://llvm.org/bugs/attachment.cgi?id=12461&action=edit
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).

-- 
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/20140430/d16f65ce/attachment.html>


More information about the llvm-bugs mailing list