-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
These asserts fail in Clang (and GCC as well) even in the C++20 mode:
static_assert(__is_constructible(int[], int, int));
static_assert(__is_nothrow_constructible(int[], int, int));However, it seems to be wrong because [meta.unary.prop] p. 9 states:
The predicate condition for a template specialization is_constructible<T, Args...> shall be satisfied if and only if the following variable definition would be well-formed for some invented variable t:
T t(declval<Args>()...);
and the following compiles (C++20 and later):
#include <type_traits>
template< class T >
std::add_rvalue_reference_t<T> declval() noexcept;
using T = int[];
T t(declval<int>(), declval<int>());It looks correct according to [dcl.init.general] p. 16.5:
... If the destination type is an array of unknown bound, it is defined as having k elements.
Is it actually a bug, or am I missing something?
frederick-vs-ja
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"