[libcxx-commits] [PATCH] D74291: [libcxx] Adds [concept.same]

Michael Schellenberger Costa via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 8 23:36:54 PST 2020


miscco added a comment.

This looks already quite good.

There are some pecularities of standard implementations that need to be considered. I started with the easy parts recently here

https://github.com/miscco/llvm-project/tree/concepts_wip



================
Comment at: libcxx/include/concepts:149
+template <class T, class U>
+concept __same_as_impl = __is_same(T, U);
+
----------------
Thinking about it more, this will not work with other compilers such as MSVC. You should seither check the Compiler aka #ifdef __clang__ or the existence of the keyword


================
Comment at: libcxx/test/std/concepts/lang/same_as.pass.cpp:8
+//===----------------------------------------------------------------------===//
+
+#include <concepts>
----------------
This test is only valid in C++20 so you should add that

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17




================
Comment at: libcxx/test/std/concepts/lang/same_as.pass.cpp:11
+
+struct S1 {};
+struct S2 {
----------------
Usually there is a comment about what is tested here

// template<class T, class U>
// concept same_as;


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74291/new/

https://reviews.llvm.org/D74291





More information about the libcxx-commits mailing list