SmallVector<const CXXRecordDecl*, 8> Queue; // actually a stack
while (true) {
- if (Derived->isDependentContext() && !Derived->hasDefinition())
+ if (Derived->isDependentContext() && !Derived->hasDefinition() &&
+ !Derived->isLambda())
return AR_dependent;
-
+
for (const auto &I : Derived->bases()) {
const CXXRecordDecl *RD;
return AR_accessible;
if (EC.isDependent()) {
- CanQualType FriendTy
- = S.Context.getCanonicalType(S.Context.getTypeDeclType(Friend));
-
- for (EffectiveContext::record_iterator
- I = EC.Records.begin(), E = EC.Records.end(); I != E; ++I) {
- CanQualType ContextTy
- = S.Context.getCanonicalType(S.Context.getTypeDeclType(*I));
- if (MightInstantiateTo(S, ContextTy, FriendTy))
+ for (const CXXRecordDecl *Context : EC.Records) {
+ if (MightInstantiateTo(Context, Friend))
return AR_dependent;
}
}
}
}
-namespace dr580 { // dr580: no
+namespace dr580 { // dr580: partial
class C;
struct A { static C c; };
struct B { static C c; };
C(); // expected-note {{here}}
~C(); // expected-note {{here}}
- typedef int I; // expected-note {{here}}
+ typedef int I; // expected-note 2{{here}}
template<int> struct X;
template<int> friend struct Y;
template<int> void f();
template<C::I> struct C::X {};
template<C::I> struct Y {};
- template<C::I> struct Z {}; // FIXME: should reject, accepted because C befriends A!
+ template<C::I> struct Z {}; // expected-error {{private}}
+
+ struct C2 {
+ class X {
+ struct A;
+ typedef int I;
+ friend struct A;
+ };
+ class Y {
+ template<X::I> struct A {}; // FIXME: We incorrectly accept this
+ // because we think C2::Y::A<...> might
+ // instantiate to C2::X::A
+ };
+ };
template<C::I> void C::f() {}
template<C::I> void g() {}
template <class T> void foo() {
[]() { A::foo(); }(); // expected-error {{private}}
}
- void bar() { foo<void>(); } // expected-note {{instantiation}}
+ void bar() { foo<void>(); }
}
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#580">580</a></td>
<td>C++11</td>
<td>Access in <I>template-parameter</I>s of member and friend definitions</td>
- <td class="none" align="center">No</td>
+ <td class="partial" align="center">Partial</td>
</tr>
<tr class="open" id="581">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#581">581</a></td>