summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2001-07-25 09:38:26 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2001-07-25 09:38:26 +0000
commit402604293366e07b85db805930f1bcf1f0bac947 (patch)
treed493c5f26270f94be4e2797ecc940088fefb192c /gcc/testsuite/g++.old-deja
parentab085207aad52d58945ea30b78c04e050d7b5a9a (diff)
downloadgcc-402604293366e07b85db805930f1bcf1f0bac947.tar.gz
re PR c++/3416 (gcc-3.0 Internal compiler error in arg_assoc, at cp/decl2.c:4902)
cp: PR c++/3416 * call.c (build_conditional_expr): Recheck args after conversions. * cp-tree.h (build_conditional_expr): Move to correct file. * typeck.c (decay_conversion): Diagnose any unknown types reaching here. (build_binary_op): Don't do initial decay or default conversions on overloaded functions. (build_static_cast): Don't do a decay conversion here. testsuite: * g++.old-deja/g++.other/cond7.C: New test. From-SVN: r44345
Diffstat (limited to 'gcc/testsuite/g++.old-deja')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond7.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond7.C b/gcc/testsuite/g++.old-deja/g++.other/cond7.C
new file mode 100644
index 00000000000..49fa73ca1f8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond7.C
@@ -0,0 +1,26 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3416. We left some unchecked overloaded functions lying around.
+
+struct X
+{
+ void operator << (int);
+ void operator << (float);
+};
+
+void OVL1 (int);
+void OVL1 (float);
+
+void OVL2 (int);
+void OVL2 (float);
+
+X x;
+
+void foo (bool a)
+{
+ x << (a ? OVL1 : OVL2); // ERROR - incomplete type
+ a ? OVL1 : OVL2; // ERROR - incomplete type
+}