http://llvm.org/bugs/show_bug.cgi?id=8107
Summary: __has_nothrow_copy not working for some types
Product: clang
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Here is a test that would be nice if it passed:
template <class T, bool Result>
void
test__has_nothrow_copy()
{
static_assert(__has_nothrow_copy(T) == Result, "");
}
class NotEmpty
{
public:
virtual ~NotEmpty();
};
int main()
{
test__has_nothrow_copy<void, false>();
test__has_nothrow_copy<int[3], false>();
test__has_nothrow_copy<int[], false>();
test__has_nothrow_copy<NotEmpty, true>();
}
The __has_nothrow_copy trait fails to compile for void types, and arrays of
unknown bounds. I believe it should compile and return false for those. I
also believe it should return false for arrays of known bounds because one can
not copy construct an array (even one of known bounds). I plan to open an LWG
issue against N3126 on this last point.
Finally, though it is a QOI issue, I believe clang should be able to detect
that the NotEmpty example above has a non-trivial but nothrow copy constructor.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs