[llvm-bugs] [Bug 24611] New: Rejects valid code: va_start in lambda function

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 28 02:25:18 PDT 2015


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

            Bug ID: 24611
           Summary: Rejects valid code: va_start in lambda function
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bisqwit at iki.fi
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

For this sample code:

    #include <cstdarg>
    #include <cstdio>

    int main()
    {
        auto test = [&](const char* fmt, ...)
        {
            va_list ap;
            va_start(ap,fmt);
            char Buf[1024];
            std::vsprintf(Buf, fmt, ap);
            va_end(ap);
            std::puts(Buf);
        };

        test("Test %d", 1);
    }

Clang++-3.6 incorrectly gives the following error message:

    tmp.cc:9:9: error: 'va_start' used in function with fixed args
            va_start(ap,fmt);

-- 
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/20150828/dc292af1/attachment-0001.html>


More information about the llvm-bugs mailing list