summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/rtti/typeid2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/rtti/typeid2.C')
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid2.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/rtti/typeid2.C b/gcc/testsuite/g++.dg/rtti/typeid2.C
new file mode 100644
index 000000000..0dbcc598b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid2.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+
+#include <typeinfo>
+
+template <typename T> const char *print_type (const T &) {
+ return typeid(T).name();
+}
+
+/* no template */ void pp1 (int) {}
+template <typename X> void pp2 (X) {}
+
+int main () {
+ if (print_type (&pp1) != print_type (&pp2<int>))
+ return 1;
+}