Open llvmbot opened 8 years ago
Hi, here is example of code which I believe valid, compiles using gcc-4.9.3 but fails to compile with clang-3.5.2, clang-3.6.2 and 3.7.0.
template<bool val> struct bool_type { static constexpr bool value = val; }; template<typename T, template<typename...> class Template> struct inst_of : bool_type<false> {}; template<template<typename...> class Template, typename... Params> struct inst_of<Template<Params...>, Template> : bool_type<true> {}; template<typename X> struct some_templ; template<typename X> using some_alias = some_templ<X>; static_assert(inst_of<some_templ<int>, some_templ>::value, "");//ok static_assert(inst_of<some_alias<int>, some_templ>::value, "");//ok static_assert(inst_of<some_alias<int>, some_alias>::value, "");//assert static_assert(inst_of<some_templ<int>, some_alias>::value, "");//assert //some more tests template<typename T> struct inst_of_some_templ : bool_type<false> {}; template<typename T> struct inst_of_some_templ<some_templ<T>> : bool_type<true> {}; template<typename T> struct inst_of_some_alias : bool_type<false> {}; template<typename T> struct inst_of_some_alias<some_alias<T>> : bool_type<true> {}; static_assert(inst_of_some_templ<some_templ<int>>::value, "");//ok static_assert(inst_of_some_templ<some_alias<int>>::value, "");//ok static_assert(inst_of_some_alias<some_alias<int>>::value, "");//ok static_assert(inst_of_some_alias<some_templ<int>>::value, "");//ok
This looks like a dup of #18411 to me.
Still occurs in 4.0 SVN. Possibly related issue/example: http://stackoverflow.com/questions/40840734
Extended Description
Hi, here is example of code which I believe valid, compiles using gcc-4.9.3 but fails to compile with clang-3.5.2, clang-3.6.2 and 3.7.0.