Qizhi Hu 8bda565733
[Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (#83847)
This patch attempts to fix
https://github.com/llvm/llvm-project/issues/25708
Current access check missed qualifier(`NestedNameSpecifier`) in friend
class checking. Add it to `Records` of `EffectiveContext` by changing
the `DeclContext` makes `MatchesFriend` work.

Co-authored-by: huqizhi <836744285@qq.com>
2024-03-13 08:42:22 +08:00

21 lines
268 B
C++

// RUN: %clang_cc1 -std=c++11 -verify %s
// expected-no-diagnostics
struct FooAccessor
{
template <typename T>
using Foo = typename T::Foo;
};
class Type
{
friend struct FooAccessor;
using Foo = int;
};
int main()
{
FooAccessor::Foo<Type> t;
}