c ++ 11 lambdas不适用于boost :: concepts

时间:2014-01-08 12:48:33

标签: c++ boost c++11 lambda concept

以下代码不适用于clang 3.3。但它确实与g ++ 4.8.1有关。 Boost版本是1.55。

#include <boost/concept_check.hpp>

template <typename X>
class  ConceptsBase {};

int main() {
    auto l = [](){};

    BOOST_CONCEPT_ASSERT((ConceptsBase<decltype(l)>));

    return 0;
}   

g ++ -std = c ++ 0x test.cpp -I / home / wygos / libs / boost_1_55_0 / include /#工作正常!

clang ++ -std = c ++ 0x test.cpp -I / home / wygos / libs / boost_1_55_0 / include /

给出:

test.cpp:9:5: error: non-type template argument refers to function 'failed' that does not have linkage
BOOST_CONCEPT_ASSERT((ConceptsBase<decltype(l)>));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/wygos/libs/boost_1_55_0/include/boost/concept/assert.hpp:44:5: note: expanded from macro 'BOOST_CONCEPT_ASSERT'
BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/wygos/libs/boost_1_55_0/include/boost/concept/detail/general.hpp:70:6: note: expanded from macro 'BOOST_CONCEPT_ASSERT_FN'
&::boost::concepts::requirement_<ModelFnPtr>::failed>    \
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/wygos/libs/boost_1_55_0/include/boost/concept/detail/general.hpp:38:17: note: non-type template argument refers to function here
static void failed() { ((Model*)0)->~Model(); }

我的幸运猜测是它可能连接到:

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

0 个答案:

没有答案