schema compile BUGFIX implicit presence containers
... must be set even in case "when" is inherited
from an augment.
diff --git a/src/schema_compile_amend.c b/src/schema_compile_amend.c
index 5eb5676..2369656 100644
--- a/src/schema_compile_amend.c
+++ b/src/schema_compile_amend.c
@@ -1863,6 +1863,13 @@
/* 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);