This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/71579] New: type_traits miss checks for type completeness in some traits
- From: "antoshkka at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 18 Jun 2016 10:12:39 +0000
- Subject: [Bug libstdc++/71579] New: type_traits miss checks for type completeness in some traits
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71579
Bug ID: 71579
Summary: type_traits miss checks for type completeness in some
traits
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: antoshkka at gmail dot com
Target Milestone: ---
Completeness is the requirement of C++ Standard. Without completeness check
hard detectable errors are possible:
#include <type_traits>
struct foo;
void kill_sanity() {
(void)std::is_constructible<foo, foo>::value;
}
struct foo{};
int main() {
static_assert(std::is_constructible<foo, foo>::value, "foo must be
constructible from foo"); // Oops!
}
All the std::is_*constructible, is_convertible, is_base_of, is_destructible,
is_*swappable, has_virtual_destructor traits are affected.
Minor: multiple triats (like aligned_union and common_type) may have a
static_assert in them, providing a more readable error message in cse of
incomplete type.