// PR c++/117294 // { dg-do compile { target c++20 } } // { dg-additional-options "-fconcepts-diagnostics-depth=2" } template struct norm { static constexpr bool value = __is_constructible(T); }; template constexpr bool norm_v = __is_constructible(T); template struct part { static constexpr bool value = __is_constructible(T); }; template struct part { static constexpr bool value = false; }; template struct part { static constexpr bool value = __is_same(T, void); }; template constexpr bool part_v = __is_constructible(T); template constexpr bool part_v = false; template constexpr bool part_v = __is_same(T, void); template struct expl { static constexpr bool value = __is_constructible(T); }; template <> struct expl { static constexpr bool value = false; }; template <> struct expl { static constexpr bool value = __is_same(int, void); }; template constexpr bool expl_v = __is_constructible(T); template <> constexpr bool expl_v = false; template <> constexpr bool expl_v = __is_same(int, void); template concept test_norm = norm::value; // { dg-line norm } template concept test_part = part::value; // { dg-line part } template concept test_expl = expl::value; // { dg-line expl } template concept test_norm_v = norm_v; // { dg-line norm_v } template concept test_part_v = part_v; // { dg-line part_v } template concept test_expl_v = expl_v; // { dg-line expl_v } static_assert(test_norm); // { dg-error "assert" } static_assert(test_part); // { dg-error "assert" } static_assert(test_expl); // { dg-error "assert" } static_assert(test_norm_v); // { dg-error "assert" } static_assert(test_part_v); // { dg-error "assert" } static_assert(test_expl_v); // { dg-error "assert" } // { dg-message "'void' is not default constructible" "" { target *-*-* } norm } // { dg-message "'void' is not default constructible" "" { target *-*-* } part } // { dg-message "'void' is not default constructible" "" { target *-*-* } expl } // { dg-message "'void' is not default constructible" "" { target *-*-* } norm_v } // { dg-message "'void' is not default constructible" "" { target *-*-* } part_v } // { dg-message "'void' is not default constructible" "" { target *-*-* } expl_v } // { dg-prune-output "'void' is incomplete" } static_assert(test_part); // { dg-error "assert" } static_assert(test_expl); // { dg-error "assert" } static_assert(test_part_v); // { dg-error "assert" } static_assert(test_expl_v); // { dg-error "assert" } // { dg-message ".with T = int\\*.. evaluated to .false." "" { target *-*-* } part } // { dg-message ".with T = int\\*.. evaluated to .false." "" { target *-*-* } expl } // { dg-message ".with T = int\\*.. evaluated to .false." "" { target *-*-* } part_v } // { dg-message ".with T = int\\*.. evaluated to .false." "" { target *-*-* } expl_v } static_assert(test_part); // { dg-error "assert" } static_assert(test_part_v); // { dg-error "assert" } // { dg-message "'int' is not the same as 'void'" "" { target *-*-* } part } // { dg-message "'int' is not the same as 'void'" "" { target *-*-* } part_v } struct S { S(int); }; static_assert(requires { requires test_norm; }); // { dg-error "assert" } static_assert(requires { requires test_part; }); // { dg-error "assert" } static_assert(requires { requires test_expl; }); // { dg-error "assert" } static_assert(requires { requires test_norm_v; }); // { dg-error "assert" } static_assert(requires { requires test_part_v; }); // { dg-error "assert" } static_assert(requires { requires test_expl_v; }); // { dg-error "assert" } // { dg-message "'S' is not default constructible" "" { target *-*-* } norm } // { dg-message "'S' is not default constructible" "" { target *-*-* } part } // { dg-message "'S' is not default constructible" "" { target *-*-* } expl } // { dg-message "'S' is not default constructible" "" { target *-*-* } norm_v } // { dg-message "'S' is not default constructible" "" { target *-*-* } part_v } // { dg-message "'S' is not default constructible" "" { target *-*-* } expl_v } // { dg-prune-output "no matching function for call" }