[libc++] Implement LWG 2911 - add an is_aggregate type-trait
Summary: This patch implements http://cplusplus.github.io/LWG/lwg-defects.html#2911. I'm putting this up for review until __is_aggregate is added to clang (See D31513) Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31515 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300126 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
|
||||
// <type_traits>
|
||||
|
||||
// template <class T> struct is_aggregate;
|
||||
// template <class T> constexpr bool is_aggregate_v = is_aggregate<T>::value;
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
int main ()
|
||||
{
|
||||
#ifdef _LIBCPP_HAS_NO_IS_AGGREGATE
|
||||
// This should not compile when _LIBCPP_HAS_NO_IS_AGGREGATE is defined.
|
||||
bool b = __is_aggregate(void);
|
||||
((void)b);
|
||||
#else
|
||||
#error Forcing failure...
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user