summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <ecoal95@gmail.com>2016-04-11 11:56:02 +0200
committerEmilio Cobos Álvarez <ecoal95@gmail.com>2016-04-11 11:56:02 +0200
commit35b2bca2e4e99672504155cb8eaa395b0c917ea5 (patch)
treee0fde73f094a92aaa445628bc3481b5cf7fb66a4
parent51c56e4d44733bfa22cc11b9f4dd7998d005a97d (diff)
parser: Try to parse nested class templates
-rw-r--r--src/parser.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index acd3a694..970e1ec8 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -618,13 +618,17 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor,
let field = FieldInfo::new(name, ty, comment, bitfields);
ci.members.push(CompMember::Field(field));
}
- CXCursor_ClassDecl | CXCursor_StructDecl | CXCursor_UnionDecl => {
+ CXCursor_StructDecl |
+ CXCursor_UnionDecl |
+ CXCursor_ClassTemplate |
+ CXCursor_ClassDecl => {
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
// to globals otherwise it will be declared later and a global.
let decl = decl_name(ctx_, cursor);
let ci2 = decl.compinfo();
+
// Mangle the name to prevent multiple definitions
// of the same inner type to cause conflicts
let new_name = [&*ci.name, &*ci2.borrow().name].join("_").to_owned();