http://llvm.org/bugs/show_bug.cgi?id=11459
Bug #: 11459
Summary: is_empty<> chokes on final
Product: libc++
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 7660
--> http://llvm.org/bugs/attachment.cgi?id=7660
Patch to make is_empty use the __is_empty intrinsic, if available
The following code will not compile:
#include <type_traits>
struct A final {};
struct B { virtual ~B() final; };
int main()
{
std::is_empty<A>::value;
std::is_empty<B>::value;
}
The error messages being:
type_traits:787:14: error: base 'A' is marked 'final' [3]
type_traits:786:8: error: declaration of '~__is_empty1' overrides a 'final'
function [3]
The current implementation if is_empty<> uses a technique that assumes every
class type can be derived from, but in presence of final that is no longer
true. I am attaching a patch that makes is_empty<> use the __is_empty intrinsic
function if it is available, as the intrinsic doesn't have this problem.
--
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