Repository navigation
[GNATS 24679] Spurious diagnostic for is_constructible expected an expression. #126
jhsedg
started this conversation in
Issue Triage - General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Customer bug ID
type_traits/test/has_nothrow_copy_test.cpp, gnats/24679.C
Description
This is a reduced test case:
template <class T, T val> struct integral_constant {
static const bool value = val;
};
struct is_constructible_imp {
template <typename T, typename, typename = decltype(new T())>
static char test1(int);
};
template <class...> struct is_constructible;
template <class T, class Arg>
struct is_constructible<T, Arg>
: integral_constant<bool, integral_constant<bool, 0>::value &&
(is_constructible_imp::test1<T, Arg>(0))> {};
template struct is_copy_constructible : is_constructible<T, T> {};
template
struct has_nothrow_copy_constructor
: integral_constant<bool, is_copy_constructible::value> {};
has_nothrow_copy_constructor<int[]> value;
fe_only -DTEST_NUMBER=1 --c++20 --gnu_version 110100 -tused -w Test_name.c
"Test_name.c", line 14: error: expected an expression
(is_constructible_imp::test1<T, Arg>(0))> {};
^
detected during:
instantiation of class "is_constructible<T, Arg> [with T=int [],
Arg=int []]" at line 15
instantiation of class "is_copy_constructible [with T=int []]"
at line 18
instantiation of class "has_nothrow_copy_constructor [with T=int
[]]" at line 19
"Test_name.c", line 14: error: expected a ")"
(is_constructible_imp::test1<T, Arg>(0))> {};
^
detected during:
instantiation of class "is_constructible<T, Arg> [with T=int [],
Arg=int []]" at line 15
instantiation of class "is_copy_constructible [with T=int []]"
at line 18
instantiation of class "has_nothrow_copy_constructor [with T=int
[]]" at line 19
"Test_name.c", line 14: error: expected a ">"
(is_constructible_imp::test1<T, Arg>(0))> {};
^
detected during:
instantiation of class "is_constructible<T, Arg> [with T=int [],
Arg=int []]" at line 15
instantiation of class "is_copy_constructible [with T=int []]"
at line 18
instantiation of class "has_nothrow_copy_constructor [with T=int
[]]" at line 19
"Test_name.c", line 18: error: class "is_copy_constructible<int []>" has no
member "value"
: integral_constant<bool, is_copy_constructible::value> {};
^
detected during instantiation of class
"has_nothrow_copy_constructor [with T=int []]" at line
19
4 errors detected in the compilation of "Test_name.c".
24679.C:fp::FAIL--NO PREVIOUS OUTPUT:
All reactions