re PR c++/10858 (failure with calling a method inside sizeof: sorry, unimplemented...
authorAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 3 Feb 2004 07:27:37 +0000 (23:27 -0800)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 3 Feb 2004 07:27:37 +0000 (23:27 -0800)
2004-02-02  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/10858
        * g++.dg/template/sizeof7.C: New test.

From-SVN: r77164

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

index 84a9692..bea92a1 100644 (file)
@@ -1,5 +1,10 @@
-2004-02-02 Eric Christopher  <echristo@redhat.com>
-           Zack Weinberg  <zack@codesourcery.com>
+2004-02-02  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/10858
+       * g++.dg/template/sizeof7.C: New test.
+
+2004-02-02  Eric Christopher  <echristo@redhat.com>
+            Zack Weinberg  <zack@codesourcery.com>
 
        * gcc.c-torture/execute/wchar_t-1.c: Add -finput-charset.
 
diff --git a/gcc/testsuite/g++.dg/template/sizeof7.C b/gcc/testsuite/g++.dg/template/sizeof7.C
new file mode 100644 (file)
index 0000000..4964bfd
--- /dev/null
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// Testcase by: bangerth@dealii.org
+// PR c++/10858: failure with calling a method inside sizeof in a template
+
+    template <int> struct P {};
+    
+    void bar ();
+    
+    template <class T> struct X {
+        static int foo(void (*)());
+        P<sizeof(foo(&bar))> p;    
+    };
+    
+    template class X<int>;