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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to