diff options
author | Emilio Cobos Álvarez <me@emiliocobos.me> | 2016-04-04 17:22:14 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <me@emiliocobos.me> | 2016-04-04 17:22:54 +0200 |
commit | e36138ea6733f882dd1d95992aaee307ff0cc69c (patch) | |
tree | dea25f77bc51935fed289c7c836634cf33d8700f | |
parent | 7ee7bae7887899642f9c07f9c02ee841e9f06556 (diff) |
parser: Allow nested classes
We didn't even tried to parse them, which is weird.
-rw-r--r-- | src/parser.rs | 2 | ||||
-rw-r--r-- | tests/headers/class_nested.hpp | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs index 9469ff72..dc4b6e06 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -614,7 +614,7 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor, let field = FieldInfo::new(name, ty, comment, bitfields); ci.members.push(CompMember::Field(field)); } - CXCursor_StructDecl | CXCursor_UnionDecl => { + CXCursor_ClassDecl | CXCursor_StructDecl | CXCursor_UnionDecl => { fwd_decl(ctx, cursor, |ctx_| { // If the struct is anonymous (i.e. declared here) then it // cannot be used elsewhere and so does not need to be added diff --git a/tests/headers/class_nested.hpp b/tests/headers/class_nested.hpp new file mode 100644 index 00000000..e9c07d64 --- /dev/null +++ b/tests/headers/class_nested.hpp @@ -0,0 +1,7 @@ +class A { + int member_a; + class B { + int member_b; + }; +}; + |