以下代码不适用于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(); }
我的幸运猜测是它可能连接到: