From 35b2bca2e4e99672504155cb8eaa395b0c917ea5 Mon Sep 17 00:00:00 2001 From: Emilio Cobos Álvarez Date: Mon, 11 Apr 2016 11:56:02 +0200 Subject: parser: Try to parse nested class templates --- src/parser.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3