[PATCH] D92024: [clang] Implement P0692R1 from C++20 (access checking on specializations and instantiations)

Alex Orlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 8 11:02:20 PDT 2021


aorlov added a comment.

@krisb Thank you for your comments. I will consider them.



================
Comment at: clang/test/CXX/temp/temp.spec/func.spec.cpp:105
+template <typename T> void func10(A::B<T>, int x) {}
+template <typename T> void func11(A::C, A::D<T>, int) {}
+template <typename T> void func12() {}
----------------
krisb wrote:
> Before this patch clang diagnosed cases like 
> 
> ```
> class A { class C {}; };
> template <typename T> void func(A::C) {}
> ```
> Why is it no longer the case?
> 
Your example generates an error `error: 'C' is a private member of 'A'` on latest clang.
This patch is intended to implement a proposal [[ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0692r1.html | p0692r1]] and consider this example as valid.
Did I understand your question correctly?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92024



More information about the cfe-commits mailing list