summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/sizeof7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/sizeof7.C')
-rw-r--r--gcc/testsuite/g++.dg/template/sizeof7.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/sizeof7.C b/gcc/testsuite/g++.dg/template/sizeof7.C
new file mode 100644
index 000000000..4964bfd25
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sizeof7.C
@@ -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>;