[LLVMbugs] [Bug 23295] New: clang requires -std=c++11 or -std=c++14 to compile lamda assignments in boost 1.57/1.58

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 20 05:42:15 PDT 2015


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

            Bug ID: 23295
           Summary: clang requires -std=c++11 or -std=c++14 to compile
                    lamda assignments in boost 1.57/1.58
           Product: clang
           Version: 2.6
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: howarth.mailing.lists at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I realize this is actually a boost bug but with the 1.58 release, it has
existed for two boost releases now. The issue is reported at
https://svn.boost.org/trac/boost/ticket/10785 and the bug details are that for
boost 1.57 and 1.58, the test case...

#include <iostream>
#include <boost/function.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>


int add(int a, int b) {
    return a+b;
}


int main() {

    boost::function<int (int, int)> fuse = boost::lambda::bind(&add,
boost::lambda::_1, -boost::lambda::_2);

    int a = fuse(3,6);
    std::cout << a << std::endl;
}

requires -std=c++11 or -std=c++14 to avoid the compiler error seen with the
default -std=c++03. The problem impacts the builds of a number of packages that
use boost and is annoying because forcing -std=c++11 sometimes results in new
compilation issues. In a related question, does clang have any form of pragma
which would allow -std=c++11 to be selectively invoked at the source file
level?

-- 
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/20150420/838aadc7/attachment.html>


More information about the llvm-bugs mailing list