[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-23 Thread Hamza Sood via Phabricator via cfe-commits
hamzasood updated this revision to Diff 156857. hamzasood added a comment. - Made the suggested test changes. The compiler is meant to create these; Clang doesn't do this yet but I'm working on the implementation. I was under the impression that the compiler support would require the library

[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-23 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added inline comments. Comment at: test/libcxx/language.support/support.contract/version.pass.cpp:9 +//===--===// + +// All the tests need `// UNSUPPORTED: c++03, c++11, c++14,

[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-23 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. I'd like to be clear that I'm not against using `ASSERT_NOEXCEPT` or `ASSERT_SAME_TYPE` - that's fine. But I'd rather you use `declval<>` - which is only useful in an unevaluated context, rather than having a function that takes a parameter - which someone might

[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-23 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. > Testing whether it's actually hooked up correctly is quite problematic; it > isn't meant to be instantiable. What's the best way to proceed with this? The compiler is supposed to create these - right? Does clang currently do this? - If not, we should wait for

[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-23 Thread Hamza Sood via Phabricator via cfe-commits
hamzasood updated this revision to Diff 156808. hamzasood added a comment. - Added a missing visibility attribute. - Added a simple test that type-checks the expected public interface. Testing whether it's actually hooked up correctly is quite problematic; it isn't meant to be instantiable.

[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-22 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. I get that lib++ will not make these things, but we still need some tests showing that the whole machinery works. Repository: rCXX libc++ https://reviews.llvm.org/D49647 ___ cfe-commits mailing list

[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-22 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. Thanks for doing this, but it needs tests before it can land. If I were to define `class contract_violation {};` that would pass the tests you've provided. (Heck, if I removed the entire definition of `contract_violation`, it would still pass.)

[PATCH] D49647: [libcxx] Library support for contracts (C++2a)

2018-07-22 Thread Hamza Sood via Phabricator via cfe-commits
hamzasood created this revision. hamzasood added reviewers: EricWF, mclow.lists, rsmith. Herald added subscribers: cfe-commits, ldionne, christof. This patch adds the library components needed for contracts in C++2a. The wording says that a contract_violation object is populated in an