diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index 2af45633..bfb783c6 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -983,8 +983,9 @@ ClassTemplate* Parser::WalkClassTemplate(clang::ClassTemplateDecl* TD) NS->Templates.push_back(CT); bool Process; - CT->TemplatedDecl = GetRecord(TD->getTemplatedDecl(), Process); - WalkRecordCXX(TD->getTemplatedDecl()); + auto RC = GetRecord(TD->getTemplatedDecl(), Process); + CT->TemplatedDecl = RC; + WalkRecordCXX(TD->getTemplatedDecl(), RC); CT->Parameters = WalkTemplateParameterList(TD->getTemplateParameters()); diff --git a/tests/CSharpTemp/CSharpTemp.Tests.cs b/tests/CSharpTemp/CSharpTemp.Tests.cs index ca80d376..d9a03bd7 100644 --- a/tests/CSharpTemp/CSharpTemp.Tests.cs +++ b/tests/CSharpTemp/CSharpTemp.Tests.cs @@ -200,4 +200,10 @@ public class CSharpTempTests : GeneratorTestFixture var res = c.Get(); Assert.That(res, Is.EqualTo(50)); } + + [Test] + public void TestInnerClasses() + { + QMap.Iterator test_iter; + } } \ No newline at end of file diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index 881026da..de76a36a 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -359,3 +359,38 @@ private: int simplePrivateField; Foo complexPrivateField; }; + + +template +class QMap +{ + struct Node + { + Key key; + T value; + }; + +public: + QMap(const QMap &other); + + class const_iterator; + + class iterator + { + public: + int test() { + return 1; + } + friend class const_iterator; + friend class QMap; + }; + friend class iterator; + + class const_iterator + { + friend class iterator; + friend class QMap; + }; + friend class const_iterator; + +}; \ No newline at end of file