redefined to the same non-trivial type
* g++.old-deja/g++.pt/explicit73.C: test for proper
namespace-qualification of template specializations declared in
other namespaces
* g++.old-deja/g++.other/friend4.C: check whether it is possible
to declare a subset of the specializations of a template function
as friends of specializations of a template class
* g++.old-deja/g++.pt/explicit71.C: make sure specializations of
member templates that do not fully specialize the enclosing
template class are rejected
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22392
138bc75d-0d04-0410-961f-
82ee72b054a4
+1998-09-12 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/typedef5.C: check whether typedefs can be
+ redefined to the same non-trivial type
+
+ * g++.old-deja/g++.pt/explicit73.C: test for proper
+ namespace-qualification of template specializations declared in
+ other namespaces
+
+ * g++.old-deja/g++.other/friend4.C: check whether it is possible
+ to declare a subset of the specializations of a template function
+ as friends of specializations of a template class
+
+ * g++.old-deja/g++.pt/explicit71.C: make sure specializations of
+ member templates that do not fully specialize the enclosing
+ template class are rejected
+
1998-09-11 Dave Love <d.love@dl.ac.uk>
* g77.f-torture/execute/u77-test.f: Fix bad consistency checks.
--- /dev/null
+// Build don't link:
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+
+// I'm not 100% sure this program is correct, but g++ shouldn't just
+// crash.
+
+// The idea is to give privileged access to bar<A> only to
+// specializations foo<A,B>, for all B.
+
+template <class A, class B> void foo();
+template <class C> class bar {
+ int i;
+ template <class B> friend void foo<C,B>();
+};
+template <class A, class B> void foo() {
+ bar<A> baz; baz.i = 1;
+ bar<int> buz; buz.i = 1; // ERROR - foo<void,void> cannot access bar<int>::i - XFAIL *-*-*
+}
+int main() {
+ foo<void,void>();
+ foo<int,void>();
+}
--- /dev/null
+// Build don't link:
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+
+typedef int t;
+typedef t* u;
+typedef int t;
+typedef t* u;
--- /dev/null
+// Build don't link:
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+// Based on a testcase by Reid M. Pinchback <reidmp@MIT.EDU>
+// According to the C++ Standard [temp.expl.spec]/17-18, explicit
+// specializations are only valid if all enclosing template classes
+// of the specialized template are fully specialized too
+
+template <class X>
+class bug {
+ template <class Y>
+ class a {};
+};
+template <class X>
+template <>
+class bug<X>::a<char> {}; // ERROR - invalid specialization
--- /dev/null
+// Build don't link:
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+
+// According to [temp.expl.spec]/2, a template explicit specialization
+// must be declared in the namespace that contains the declaration of
+// the template
+
+namespace N {
+ template <class T> class foo;
+}
+
+using namespace N;
+
+template <> class foo<void>; // ERROR - invalid specialization - XFAIL *-*-*