OSDN Git Service

PR c++/37806
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Mar 2009 18:37:49 +0000 (18:37 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Mar 2009 18:37:49 +0000 (18:37 +0000)
        * g++.dg/template/typedef17.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145366 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/typedef17.C [new file with mode: 0644]

index 43ae63d..5205c39 100644 (file)
@@ -1,5 +1,8 @@
 2009-03-31  Jason Merrill  <jason@redhat.com>
 
+       PR c++/37806
+       * g++.dg/template/typedef17.C: New test.
+
        * g++.dg/cpp0x/auto6.C: Adjust expected mangling.
        * g++.dg/cpp0x/auto12.C: Likewise.
 
diff --git a/gcc/testsuite/g++.dg/template/typedef17.C b/gcc/testsuite/g++.dg/template/typedef17.C
new file mode 100644 (file)
index 0000000..263e288
--- /dev/null
@@ -0,0 +1,32 @@
+// PR c++/37806
+
+extern "C" int printf (const char *, ...);
+
+template <typename T>
+struct S1
+{
+  typedef void (function_type)(int) const;
+};
+
+
+struct S2: public S1<int>
+{
+  virtual function_type f = 0;
+};
+
+struct S3: public S2
+{
+  void 
+  f (int i) const
+  {
+    printf ("Hello world: %d\n", i);
+  }
+};
+
+
+int
+main()
+{
+  S3 s;
+  s.f(5);
+}