schema compile BUGFIX implicit presence containers
... must be set even in case "when" is inherited
from an augment.
@@ -1863,6 +1863,13 @@ lys_compile_augment(struct lysc_ctx *ctx, struct lysp_augment *aug_p, struct lys
/* pass augment's when to all the children */
ret = lys_compile_when(ctx, aug_p->when, aug_p->flags, lysc_xpath_context(target), node, &when_shared);
LY_CHECK_GOTO(ret, cleanup);
+
+ if ((node->nodetype == LYS_CONTAINER) && !(node->flags & LYS_PRESENCE)) {
+ /* container with a when condition */
+ LOGWRN(ctx->ctx, "Container \"%s\" changed to presence because it has a meaning from its "
+ "inherited \"when\" condition.", node->name);
+ node->flags |= LYS_PRESENCE;
+ }
}
}
ly_set_erase(&child_set, NULL);
