[PATCH] D92024: [clang] Implement P0692R1 from C++20 (access checking on specializations and instantiations)
Kristina Bessonova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 7 02:46:28 PDT 2021
krisb added inline comments.
================
Comment at: clang/lib/Parse/ParseDecl.cpp:3001
DS.getStorageClassSpec() == clang::DeclSpec::SCS_typedef &&
- !DS.hasTypeSpecifier() && GetLookAheadToken(1).is(tok::less))
+ !DS.hasTypeSpecifier() && NextToken().is(tok::less))
Tok.setKind(tok::identifier);
----------------
It seems to be a change unrelated to the patch.
================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1414
// C++03 [temp.explicit] 14.7.2/8:
// The usual access checking rules do not apply to names used to specify
----------------
The comment needs to be updated.
================
Comment at: clang/test/CXX/temp/temp.spec/func.spec.cpp:95
+// expected-error at +1 {{is a protected member of}}
+template <typename T> class A::B<int> func4() { A::B<A::C> x; } template <typename T> void func5() {
+ // expected-error at +2 {{is a private member of}}
----------------
Formatting issue here.
================
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() {}
----------------
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?
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