This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/71579] New: type_traits miss checks for type completeness in some traits


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]