diff --git a/src/AST/ASTVisitor.cs b/src/AST/ASTVisitor.cs
index 53704967..dbbf9ecf 100644
--- a/src/AST/ASTVisitor.cs
+++ b/src/AST/ASTVisitor.cs
@@ -179,8 +179,11 @@ namespace CppSharp.AST
}
}
- return template.IsDependent ? template.Template.Visit(this) :
- template.GetClassTemplateSpecialization().Visit(this);
+ if (template.IsDependent)
+ return template.Template.Visit(this);
+
+ var specialization = template.GetClassTemplateSpecialization();
+ return specialization != null && specialization.Visit(this);
}
public virtual bool VisitTemplateParameterType(TemplateParameterType param,
diff --git a/src/AST/Type.cs b/src/AST/Type.cs
index 5ea1a0e1..00335214 100644
--- a/src/AST/Type.cs
+++ b/src/AST/Type.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using CppSharp.AST.Extensions;
namespace CppSharp.AST
{
@@ -636,11 +637,16 @@ namespace CppSharp.AST
public ClassTemplateSpecialization GetClassTemplateSpecialization()
{
- var tagType = Desugared as TagType;
+ var finalType = Desugared.GetFinalPointee() ?? Desugared;
+
+ var tagType = finalType as TagType;
if (tagType != null)
return (ClassTemplateSpecialization) tagType.Declaration;
- var injectedClassNameType = (InjectedClassNameType) Desugared;
+ var injectedClassNameType = finalType as InjectedClassNameType;
+ if (injectedClassNameType == null)
+ return null;
+
var injectedSpecializationType = (TemplateSpecializationType)
injectedClassNameType.InjectedSpecializationType.Type;
return injectedSpecializationType.GetClassTemplateSpecialization();
diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
index b123241a..88f71672 100644
--- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
+++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs
index 8fb2202c..03e7768f 100644
--- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs
+++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs
index 36e45d56..7887a35a 100644
--- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs
+++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
index 6158a85c..918b4984 100644
--- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
+++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
index fb6c2d12..a6cb9845 100644
--- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
+++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
index 48f3bdf2..52bbb48a 100644
--- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
+++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs
index 64f28510..f2f6da9c 100644
--- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs
+++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
index 9280357e..da1a9f69 100644
--- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
+++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
index f07e0272..95fccb3d 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs
index 2b8f35f1..bc0920d6 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs
index 36e45d56..7887a35a 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs
index fdf99e4e..41891deb 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
index 3d6fccc3..657df888 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs
index 0aa7df97..f967a685 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs
index 36e45d56..7887a35a 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs
index 44ed85ba..bf00f41b 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/AST.cs
index 7e5baff5..118aef56 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/AST.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/AST.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppParser.cs
index 38012f0f..0df31f4a 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppParser.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppParser.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Sources.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Sources.cs
index 5a0119d9..4100d792 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Sources.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Sources.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Target.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Target.cs
index 8bebe1fe..b8824a5f 100644
--- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Target.cs
+++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Target.cs
@@ -1,6 +1,8 @@
//----------------------------------------------------------------------------
+//
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
+//
//----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;