llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Corentin Jabot (cor3ntin) <details> <summary>Changes</summary> Because concepts were checked for satisfaction in the wrong contexts, we ended up creating deduction guides in the wrong contexts. Fixes #<!-- -->197067 --- Full diff: https://github.com/llvm/llvm-project/pull/197634.diff 2 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+1-1) - (modified) clang/test/SemaTemplate/concepts.cpp (+32) ``````````diff diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index b49286b35c6b0..3c9baf25c8028 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -576,7 +576,7 @@ Bug Fixes to C++ Support - Fixed a crash on error recovery when dealing with invalid templates. (#GH183075) - Fixed a crash when instantiating ``requires`` expressions involving substitution failures in C++ concepts. (#GH176402) - Concepts appearing in the require-clause of a member function no longer have access to non-public members of that class, - or to a current class object. (#GH115838) (#GH194803) + or to a current class object. (#GH115838) (#GH194803) (#GH197067) - We no longer caches invalid variable specializations. (#GH132592) - Fixed an incorrect template argument deduction when matching packs of template template parameters when one of its parameters is also a pack. (#GH181166) diff --git a/clang/test/SemaTemplate/concepts.cpp b/clang/test/SemaTemplate/concepts.cpp index 72a2fab99c581..86d6c4483cb73 100644 --- a/clang/test/SemaTemplate/concepts.cpp +++ b/clang/test/SemaTemplate/concepts.cpp @@ -1947,3 +1947,35 @@ static_assert(D<Publ>::has, "Public should be visible."); static_assert(!D<Priv>::has, "Private should be invisible."); static_assert(!D<Prot>::has, "Protected should be invisible."); } + + +namespace GH197067 { +typedef int uint32_t; +class basic_string; +using string = basic_string; +using __self_view = int; +struct basic_string { + basic_string(const char *); + operator __self_view(); +}; +int GetVmo(int); +template <typename> struct StorageTraits; +template <class Traits, typename Storage> +concept StorageTraitsBufferedReadApi = + requires(Storage storage_ref, uint32_t length) { + Traits::Read(storage_ref, length, length, [] {}); + }; +template <class Traits, typename Storage> +concept StorageTraitsApi = StorageTraitsBufferedReadApi<Traits, Storage>; +template <typename T> +concept StorageApi = StorageTraitsApi<StorageTraits<T>, T>; +template <StorageApi Storage> struct View { + using storage_type = Storage; + storage_type storage_; +}; +template <> struct StorageTraits<int> { + template <typename Callback> + static auto Read(int, long, uint32_t, Callback) {} +}; +View zbi(GetVmo(string(""))); +} `````````` </details> https://github.com/llvm/llvm-project/pull/197634 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
