@@ -670,3 +670,57 @@ namespace dr165 { // dr165: no
670
670
// FIXME: dr165 says this is ill-formed, but the argument in dr1477 says it's ok
671
671
void N::g () {}
672
672
}
673
+
674
+ namespace dr166 { // dr166: yes
675
+ namespace A { class X ; }
676
+
677
+ template <typename T> int f (T t) { return t.n ; }
678
+ int g (A::X);
679
+ template <typename T> int h (T t) { return t.n ; } // expected-error {{private}}
680
+ int i (A::X);
681
+
682
+ namespace A {
683
+ class X {
684
+ friend int f<X>(X);
685
+ friend int dr166::g (X);
686
+ friend int h (X);
687
+ friend int i (X);
688
+ int n; // expected-note 2{{here}}
689
+ };
690
+
691
+ int h (X x) { return x.n ; }
692
+ int i (X x) { return x.n ; }
693
+ }
694
+
695
+ template int f (A::X);
696
+ int g (A::X x) { return x.n ; }
697
+ template int h (A::X); // expected-note {{instantiation}}
698
+ int i (A::X x) { return x.n ; } // expected-error {{private}}
699
+ }
700
+
701
+ // dr167: sup 1012
702
+
703
+ namespace dr168 { // dr168: no
704
+ extern " C" typedef int (*p)();
705
+ extern " C++" typedef int (*q)();
706
+ struct S {
707
+ static int f ();
708
+ };
709
+ p a = &S::f; // FIXME: this should fail.
710
+ q b = &S::f;
711
+ }
712
+
713
+ namespace dr169 { // dr169: yes
714
+ template <typename > struct A { int n; };
715
+ struct B {
716
+ template <typename > struct C ;
717
+ template <typename > void f ();
718
+ template <typename > static int n; // expected-error 0-1{{extension}}
719
+ };
720
+ struct D : A<int >, B {
721
+ using A<int >::n;
722
+ using B::C<int >; // expected-error {{using declaration can not refer to a template specialization}}
723
+ using B::f<int >; // expected-error {{using declaration can not refer to a template specialization}}
724
+ using B::n<int >; // expected-error {{using declaration can not refer to a template specialization}}
725
+ };
726
+ }
0 commit comments