The problem is seems to be related with evaluate_dereference() where all mods are dropped when the type is a node. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/eval/array-quals-node.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 validation/eval/array-quals-node.c diff --git a/validation/eval/array-quals-node.c b/validation/eval/array-quals-node.c new file mode 100644 index 000000000000..99a4db13e4da --- /dev/null +++ b/validation/eval/array-quals-node.c @@ -0,0 +1,29 @@ +struct s { + int a; + int b[3]; + int c[2][3]; +}; + +struct c { + const struct s s; +}; + +extern struct c v; + +void f(void) +{ + v.s.a = 0; + *v.s.b = 0; + **v.s.c = 0; +} + +/* + * check-name: array-quals-node + * check-known-to-fail + * + * check-error-start +eval/array-quals-node.c:15:14: error: assignment to const expression +eval/array-quals-node.c:16:14: error: assignment to const expression +eval/array-quals-node.c:17:14: error: assignment to const expression + * check-error-end + */ -- 2.27.0