]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Sat, 6 Dec 2003 22:19:30 +0000 (22:19 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sat, 6 Dec 2003 22:19:30 +0000 (22:19 +0000)
'gcc-3_3-branch'.

From-SVN: r74371

gcc/testsuite/g++.dg/inherit/operator2.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/inherit/operator2.C b/gcc/testsuite/g++.dg/inherit/operator2.C
new file mode 100644 (file)
index 0000000..09407e1
--- /dev/null
@@ -0,0 +1,22 @@
+typedef int INT_TYPEDEF;
+
+template<class T>
+class TypedIfc
+{
+public:
+  virtual ~TypedIfc() { }
+  virtual operator const T&() const = 0;
+  virtual const T& operator= (const T& t) = 0;
+};
+
+template<class Tnative>
+class NullIfc : public TypedIfc<Tnative>
+{
+public:
+  const Tnative& operator= (const Tnative& t) { return t; }
+  operator const Tnative&() const { return *(Tnative *)0; }
+};
+
+typedef TypedIfc<INT_TYPEDEF> INT_TYPEDEFIfc;
+
+NullIfc<int> i32;