Access to a public template alias declaration that refers to friend's private nested type is not allowed. (original) (raw)

Bugzilla Link 25334
Version 3.7
OS Linux
Attachments test code (also in the text)
CC @DougGregor,@ecatmur

Extended Description

The test case that fails is:

struct FooAccessor { template using Foo = typename T::Foo; };

class Type { friend struct FooAccessor;

using Foo = int;

};

int main() { FooAccessor::Foo t; }

The result is:

$ clang++ test.cpp -std=c++11 test.cpp:4:5: error: 'Foo' is a private member of 'Type' using Foo = typename T::Foo; ^ test.cpp:11:11: note: implicitly declared private here using Foo = int; ^ 1 error generated.