Hi, as I mentioned a few days ago, I'm working on implementing this feature, which I personally consider rather high priority, from the library point of view too (eg, ). I have been making some progress - I'm attaching below what I have so far in my local tree - but I also think it's time to get feedback both about the general approach and about more specific issues with the testsuite. The attached leads to unexpected fails for 4 testcases in g++.dg, which I would bundle in 2 pairs: I (we) should obviously do something about both but the second one seems more subtle (and indeed I'm looking for guidance!). The first pair is: FAIL: g++.dg/template/access7.C -std=c++98 (test for errors, line 8) FAIL: g++.dg/template/access7.C -std=c++98 (test for errors, line 12) FAIL: g++.dg/template/access7.C -std=c++98 (test for warnings, line 17) FAIL: g++.dg/template/access7.C -std=c++98 (test for excess errors) FAIL: g++.dg/template/access7.C -std=c++11 (test for excess errors) FAIL: g++.dg/template/typedef11.C -std=c++98 (test for errors, line 8) FAIL: g++.dg/template/typedef11.C -std=c++98 (test for errors, line 14) FAIL: g++.dg/template/typedef11.C -std=c++98 (test for errors, line 25) FAIL: g++.dg/template/typedef11.C -std=c++98 (test for excess errors) FAIL: g++.dg/template/typedef11.C -std=c++11 (test for errors, line 8) FAIL: g++.dg/template/typedef11.C -std=c++11 (test for errors, line 14) FAIL: g++.dg/template/typedef11.C -std=c++11 (test for errors, line 25) FAIL: g++.dg/template/typedef11.C -std=c++11 (test for excess errors) The problem is that with the patch applied we get errors of the "no matching function" type, instead of access control errors. For example, for access7.C: access7.C: In function ‘void g()’: access7.C:17:15: error: no matching function for call to ‘f(S)’ f (S ()); // { dg-message "required" } ^ access7.C:17:15: note: candidate is: access7.C:12:16: note: template typename A::T* f(A) typename A::T* f (A) { // { dg-error "this context" } ^ I suppose this is expected, right?!? (we may have more in old-deja, have to re-check) The second pair is more subtle: FAIL: g++.dg/template/friend13.C -std=c++11 (test for excess errors) FAIL: g++.dg/template/friend15.C -std=c++98 (test for excess errors) FAIL: g++.dg/template/friend15.C -std=c++11 (test for excess errors) That is, we have that the first one fails only in c++11 mode, rather subtle per se. And in general friend* cases seem quite unexpected to me. Now, something rather interesting is that, clang 3.0, which I tried online, rejects friend13 and friend15 as patched GCC does, thus disagreeing with current mainline. For example, for friend13.C, it emits an access control error for struct Inner in the context of line 8, like patched GCC. And, for friend15.C, an error @ line 18, for undeclared 'foo', whereas patched GCC gives "no matching function for call to ‘foo()’" for the same line. Thanks for any help! Paolo. /////////////////////////