On 28 Jun 2017, at 00:53, dariomt@gmail.com wrote:
2017-06-27 17:46 GMT+02:00 d25fe0be@outlook.com
: So I suspect this is a bug in 'type_traits' library, but I'm not sure. Hopefully somebody else can confirm. (I'm sorry but I don't know to whom should I CC this post.) I don't know why clang accepts your code though. Perhaps `boost::is_convertible` is conditionally compiled to some different implementations in Clang.
Thanks for the analysis. My guess is that clang uses a different implementation of is_convertible. Also, I guess this works in C++14 because std::is_convertible is used instead?
Yes, after a deeper dig, `boost/type_traits/intrinsics.hpp` shows that `type_traits` uses Clang's intrinsics to do the job:
```
157 #if defined(BOOST_CLANG) && defined(__has_feature) && !defined(__CUDACC__)
[...]
213 # if __has_feature(is_convertible_to)
214 # define BOOST_IS_CONVERTIBLE(T,U) __is_convertible_to(T,U)
215 # endif
```
After commenting out macro `BOOST_IS_CONVERTIBLE`, clang errors out the original code as well.
And I believe this finding gives us an easier workaround: Just defining our own `BOOST_IS_CONVERTIBLE` before including `boost/variant.hpp`, and the compilation error should disappear.
```
#include