aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/constref2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/constref2.C')
-rw-r--r--gcc/testsuite/g++.dg/other/constref2.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/constref2.C b/gcc/testsuite/g++.dg/other/constref2.C
new file mode 100644
index 00000000000..5c82e2dbbdb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/constref2.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Matt Austern 12 Sep 2002 <austern@apple.com>
+
+// Make sure that we can pass a cast-expression as an argument that's
+// passed to a function template by const reference.
+
+template <class T>
+void bar (const T&)
+{ }
+
+void foo (int x)
+{
+ bar ((long) x);
+}