summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p4173.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike/p4173.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4173.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4173.C b/gcc/testsuite/g++.old-deja/g++.mike/p4173.C
new file mode 100644
index 000000000..e07bc0695
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4173.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// { dg-options "-Wall -ansi -pedantic-errors" }
+// This error happens because lvalue is not done well in the C++ front-end.
+// NOPs should be lvalues if their arguments are.
+// NON_LVALUE_EXPRs shouldn't be.
+
+// prms-id: 4173
+
+enum TypeKind {
+ RecordTypeKind
+};
+struct Type
+{
+ enum TypeKind kind : 8;
+ unsigned char prefixLen;
+};
+
+Type a;
+Type b;
+TypeKind c;
+
+int
+main() {
+ a.kind = b.kind = c;
+ (a.kind = c) = b.kind; // { dg-bogus "" }
+}