All of the static_asserts in the following code result in compile error with -std=c++11. //////////////////////////////////////// #include <type_traits> struct A{}; struct B : A{}; int main() { static_assert(!std::is_constructible<B &&, A>(), ""); static_assert(!std::is_constructible<B const &&, A>(), ""); static_assert(!std::is_constructible<B const &&, A const>(), ""); static_assert(!std::is_constructible<B volatile &&, A>(), ""); static_assert(!std::is_constructible<B volatile &&, A volatile>(), ""); static_assert(!std::is_constructible<B const volatile &&, A>(), ""); static_assert(!std::is_constructible<B const volatile &&, A const>(), ""); static_assert(!std::is_constructible<B const volatile &&, A volatile>(), ""); static_assert(!std::is_constructible<B const volatile &&, A const volatile>(), ""); } ////////////////////////////////////////
Daniel, can you have a look?
(In reply to comment #1) The root of the problem is that __is_base_to_derived_ref works on source references solely. I need a bit time for a proper fix.
Thanks a lot!
Author: paolo Date: Mon Nov 21 11:21:13 2011 New Revision: 181557 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181557 Log: 2011-11-21 Daniel Krugler <daniel.kruegler@googlemail.com> PR libstdc++/51185 * include/std/type_traits (__is_base_to_derived_ref, __is_lvalue_to_rvalue_ref): Fix. * testsuite/20_util/is_constructible/51185.cc: New. * testsuite/20_util/is_constructible/value-2.cc: Extend. Added: trunk/libstdc++-v3/testsuite/20_util/is_constructible/51185.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/std/type_traits trunk/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc trunk/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc trunk/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc trunk/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
Fixed.