summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike/p3524b.C')
-rwxr-xr-xgcc/testsuite/g++.old-deja/g++.mike/p3524b.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C b/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C
new file mode 100755
index 0000000..c645d4c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C
@@ -0,0 +1,21 @@
+// Make sure we can cast to a templated type, that requires a conversion by
+// constructor, from a derived type to a base type.
+
+// Build don't link:
+// prms-id: 3524
+
+template <class T>
+struct ccPair {
+ ccPair () { }
+};
+
+template <class T>
+struct ccO : ccPair<T> {
+ ccO () { }
+};
+
+void foo ()
+{
+ ccO<float> r;
+ (ccPair<float>)r;
+}