Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.mike/p4173.C

raw
1 // { dg-do assemble }
2 // { dg-options "-Wall -ansi -pedantic-errors" }
3 // This error happens because lvalue is not done well in the C++ front-end.
4 // NOPs should be lvalues if their arguments are.
5 // NON_LVALUE_EXPRs shouldn't be.
6
7 // prms-id: 4173
8
9 enum TypeKind {
10 RecordTypeKind
11 };
12 struct Type
13 {
14 enum TypeKind kind : 8;
15 unsigned char prefixLen;
16 };
17
18 Type a;
19 Type b;
20 TypeKind c;
21
22 int
23 main() {
24 a.kind = b.kind = c;
25 (a.kind = c) = b.kind; // { dg-bogus "" }
26 }