--- old/src/jdk.jextract/share/classes/com/sun/tools/jextract/tree/StructTree.java 2018-09-12 21:18:07.000000000 +0530 +++ new/src/jdk.jextract/share/classes/com/sun/tools/jextract/tree/StructTree.java 2018-09-12 21:18:06.000000000 +0530 @@ -87,6 +87,26 @@ return cursor().kind() == CursorKind.UnionDecl; } + /** + * Is this struct/union declared as anonymous member of another struct/union? + * + * Example: + * + * struct X { + * struct { int i; int j; }; // <-- anonymous struct + * long l; + * }; + * + * Note: this is specific use of the word 'anonymous'. A struct with name() + * being empty is not necessarily anonymous in this usage. + * + * The structs in the following declarations are *not* anonymous eventhough + * the names of these structs are empty. + * + * struct { int i; int j; } thePoint; + * void func(struct { char* name; int len; } p1); + * typedef struct { int i; int j; } Point; + */ public boolean isAnonymous() { return cursor().isAnonymousStruct(); }