aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C b/gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C
new file mode 100644
index 00000000000..2fba73c9c87
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C
@@ -0,0 +1,20 @@
+// PRMS Id: 4892
+// Bug: COND_EXPRs, MODIFY_EXPRs and COMPOUND_EXPRs aren't properly recognized
+// as lvalues.
+// Build don't link:
+
+extern int foo;
+int& f (int& a, int& b)
+{
+ return (foo ? a : b); // gets bogus error -
+}
+
+int& g (int& a)
+{
+ return (a = 0); // gets bogus error -
+}
+
+int& h (int& a, int& b)
+{
+ return (a = 1, b); // gets bogus error -
+}