[LLVMbugs] [Bug 16839] New: result of passing an array of unknown bound to is_destructible is wrong

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 8 17:58:38 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16839

            Bug ID: 16839
           Summary: result of passing an array of unknown bound to
                    is_destructible is wrong
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: y121516 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Testing code is as follows:


#include<type_traits>
static_assert(std::is_destructible<int[]>::value == false, "");
int main(){};



compile error message is as follow:


prog.cc:2:1: error: static_assert failed ""
static_assert(std::is_destructible<int[]>::value == false, "");
^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.



On the other hand Standard (§ 20.9.4.3 Table 49 — Type property predicates)
says:

Template

template <class T>
struct is_destructible;


Condition

For a complete type T and
given
template <class U>
struct test { U u; };,
test<T>::˜test() is not
deleted.


Preconditions

T shall be a complete type,
(possibly cv-qualified)
void, or an array of
unknown bound.



An array of unknown bound is incomplete type (§ 3.9).
So, I think that std::is_destructible<int[]> should be derived from false_type.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130809/2cf2ce8d/attachment.html>


More information about the llvm-bugs mailing list