Skip to content

Commit bb31bd6

Browse files
authored
Add type parameter to non-type template parameter decls. (mono#1749)
1 parent add3aba commit bb31bd6

File tree

13 files changed

+120
-0
lines changed

13 files changed

+120
-0
lines changed

src/AST/Template.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ public class NonTypeTemplateParameter : Declaration
124124
/// </summary>
125125
public bool IsExpandedParameterPack { get; set; }
126126

127+
public QualifiedType Type { get; set; }
128+
127129
public override T Visit<T>(IDeclVisitor<T> visitor)
128130
{
129131
return visitor.VisitNonTypeTemplateParameterDecl(this);

src/CppParser/AST.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ NonTypeTemplateParameter::NonTypeTemplateParameter(const NonTypeTemplateParamete
164164
, position(rhs.position)
165165
, isPackExpansion(rhs.isPackExpansion)
166166
, isExpandedParameterPack(rhs.isExpandedParameterPack)
167+
, type(rhs.type)
167168
{
168169
}
169170

src/CppParser/Bindings/CLI/Decl.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4224,6 +4224,18 @@ void CppSharp::Parser::AST::NonTypeTemplateParameter::IsExpandedParameterPack::s
42244224
((class ::CppSharp::CppParser::AST::NonTypeTemplateParameter*)NativePtr)->isExpandedParameterPack = value;
42254225
}
42264226

4227+
CppSharp::Parser::AST::QualifiedType^ CppSharp::Parser::AST::NonTypeTemplateParameter::Type::get()
4228+
{
4229+
return (&((class ::CppSharp::CppParser::AST::NonTypeTemplateParameter*)NativePtr)->type == nullptr) ? nullptr : gcnew ::CppSharp::Parser::AST::QualifiedType((struct ::CppSharp::CppParser::AST::QualifiedType*)&((class ::CppSharp::CppParser::AST::NonTypeTemplateParameter*)NativePtr)->type);
4230+
}
4231+
4232+
void CppSharp::Parser::AST::NonTypeTemplateParameter::Type::set(CppSharp::Parser::AST::QualifiedType^ value)
4233+
{
4234+
if (ReferenceEquals(value, nullptr))
4235+
throw gcnew ::System::ArgumentNullException("value", "Cannot be null because it is passed by value.");
4236+
((class ::CppSharp::CppParser::AST::NonTypeTemplateParameter*)NativePtr)->type = *(struct ::CppSharp::CppParser::AST::QualifiedType*)value->NativePtr;
4237+
}
4238+
42274239
CppSharp::Parser::AST::ClassTemplate::ClassTemplate(class ::CppSharp::CppParser::AST::ClassTemplate* native)
42284240
: CppSharp::Parser::AST::Template((::CppSharp::CppParser::AST::Template*)native)
42294241
{

src/CppParser/Bindings/CLI/Decl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,12 @@ namespace CppSharp
20982098
bool get();
20992099
void set(bool);
21002100
}
2101+
2102+
property CppSharp::Parser::AST::QualifiedType^ Type
2103+
{
2104+
CppSharp::Parser::AST::QualifiedType^ get();
2105+
void set(CppSharp::Parser::AST::QualifiedType^);
2106+
}
21012107
};
21022108

21032109
public ref class ClassTemplate : CppSharp::Parser::AST::Template

src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13017,6 +13017,7 @@ public unsafe partial class NonTypeTemplateParameter : global::CppSharp.Parser.A
1301713017
internal uint position;
1301813018
internal byte isPackExpansion;
1301913019
internal byte isExpandedParameterPack;
13020+
internal global::CppSharp.Parser.AST.QualifiedType.__Internal type;
1302013021

1302113022
[SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST24NonTypeTemplateParameterC2Ev", CallingConvention = __CallingConvention.Cdecl)]
1302213023
internal static extern void ctor(__IntPtr __instance);
@@ -13171,6 +13172,21 @@ public bool IsExpandedParameterPack
1317113172
((__Internal*)__Instance)->isExpandedParameterPack = (byte) (value ? 1 : 0);
1317213173
}
1317313174
}
13175+
13176+
public global::CppSharp.Parser.AST.QualifiedType Type
13177+
{
13178+
get
13179+
{
13180+
return global::CppSharp.Parser.AST.QualifiedType.__CreateInstance(new __IntPtr(&((__Internal*)__Instance)->type));
13181+
}
13182+
13183+
set
13184+
{
13185+
if (ReferenceEquals(value, null))
13186+
throw new global::System.ArgumentNullException("value", "Cannot be null because it is passed by value.");
13187+
((__Internal*)__Instance)->type = *(global::CppSharp.Parser.AST.QualifiedType.__Internal*) value.__Instance;
13188+
}
13189+
}
1317413190
}
1317513191

1317613192
public unsafe partial class ClassTemplate : global::CppSharp.Parser.AST.Template, IDisposable

src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13017,6 +13017,7 @@ public unsafe partial class NonTypeTemplateParameter : global::CppSharp.Parser.A
1301713017
internal uint position;
1301813018
internal byte isPackExpansion;
1301913019
internal byte isExpandedParameterPack;
13020+
internal global::CppSharp.Parser.AST.QualifiedType.__Internal type;
1302013021

1302113022
[SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "??0NonTypeTemplateParameter@AST@CppParser@CppSharp@@QAE@XZ", CallingConvention = __CallingConvention.ThisCall)]
1302213023
internal static extern __IntPtr ctor(__IntPtr __instance);
@@ -13171,6 +13172,21 @@ public bool IsExpandedParameterPack
1317113172
((__Internal*)__Instance)->isExpandedParameterPack = (byte) (value ? 1 : 0);
1317213173
}
1317313174
}
13175+
13176+
public global::CppSharp.Parser.AST.QualifiedType Type
13177+
{
13178+
get
13179+
{
13180+
return global::CppSharp.Parser.AST.QualifiedType.__CreateInstance(new __IntPtr(&((__Internal*)__Instance)->type));
13181+
}
13182+
13183+
set
13184+
{
13185+
if (ReferenceEquals(value, null))
13186+
throw new global::System.ArgumentNullException("value", "Cannot be null because it is passed by value.");
13187+
((__Internal*)__Instance)->type = *(global::CppSharp.Parser.AST.QualifiedType.__Internal*) value.__Instance;
13188+
}
13189+
}
1317413190
}
1317513191

1317613192
public unsafe partial class ClassTemplate : global::CppSharp.Parser.AST.Template, IDisposable

src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13016,6 +13016,7 @@ public unsafe partial class NonTypeTemplateParameter : global::CppSharp.Parser.A
1301613016
internal uint position;
1301713017
internal byte isPackExpansion;
1301813018
internal byte isExpandedParameterPack;
13019+
internal global::CppSharp.Parser.AST.QualifiedType.__Internal type;
1301913020

1302013021
[SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST24NonTypeTemplateParameterC2Ev", CallingConvention = __CallingConvention.Cdecl)]
1302113022
internal static extern void ctor(__IntPtr __instance);
@@ -13170,6 +13171,21 @@ public bool IsExpandedParameterPack
1317013171
((__Internal*)__Instance)->isExpandedParameterPack = (byte) (value ? 1 : 0);
1317113172
}
1317213173
}
13174+
13175+
public global::CppSharp.Parser.AST.QualifiedType Type
13176+
{
13177+
get
13178+
{
13179+
return global::CppSharp.Parser.AST.QualifiedType.__CreateInstance(new __IntPtr(&((__Internal*)__Instance)->type));
13180+
}
13181+
13182+
set
13183+
{
13184+
if (ReferenceEquals(value, null))
13185+
throw new global::System.ArgumentNullException("value", "Cannot be null because it is passed by value.");
13186+
((__Internal*)__Instance)->type = *(global::CppSharp.Parser.AST.QualifiedType.__Internal*) value.__Instance;
13187+
}
13188+
}
1317313189
}
1317413190

1317513191
public unsafe partial class ClassTemplate : global::CppSharp.Parser.AST.Template, IDisposable

src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13016,6 +13016,7 @@ public unsafe partial class NonTypeTemplateParameter : global::CppSharp.Parser.A
1301613016
internal uint position;
1301713017
internal byte isPackExpansion;
1301813018
internal byte isExpandedParameterPack;
13019+
internal global::CppSharp.Parser.AST.QualifiedType.__Internal type;
1301913020

1302013021
[SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST24NonTypeTemplateParameterC2Ev", CallingConvention = __CallingConvention.Cdecl)]
1302113022
internal static extern void ctor(__IntPtr __instance);
@@ -13170,6 +13171,21 @@ public bool IsExpandedParameterPack
1317013171
((__Internal*)__Instance)->isExpandedParameterPack = (byte) (value ? 1 : 0);
1317113172
}
1317213173
}
13174+
13175+
public global::CppSharp.Parser.AST.QualifiedType Type
13176+
{
13177+
get
13178+
{
13179+
return global::CppSharp.Parser.AST.QualifiedType.__CreateInstance(new __IntPtr(&((__Internal*)__Instance)->type));
13180+
}
13181+
13182+
set
13183+
{
13184+
if (ReferenceEquals(value, null))
13185+
throw new global::System.ArgumentNullException("value", "Cannot be null because it is passed by value.");
13186+
((__Internal*)__Instance)->type = *(global::CppSharp.Parser.AST.QualifiedType.__Internal*) value.__Instance;
13187+
}
13188+
}
1317313189
}
1317413190

1317513191
public unsafe partial class ClassTemplate : global::CppSharp.Parser.AST.Template, IDisposable

src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13016,6 +13016,7 @@ public unsafe partial class NonTypeTemplateParameter : global::CppSharp.Parser.A
1301613016
internal uint position;
1301713017
internal byte isPackExpansion;
1301813018
internal byte isExpandedParameterPack;
13019+
internal global::CppSharp.Parser.AST.QualifiedType.__Internal type;
1301913020

1302013021
[SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST24NonTypeTemplateParameterC2Ev", CallingConvention = __CallingConvention.Cdecl)]
1302113022
internal static extern void ctor(__IntPtr __instance);
@@ -13170,6 +13171,21 @@ public bool IsExpandedParameterPack
1317013171
((__Internal*)__Instance)->isExpandedParameterPack = (byte) (value ? 1 : 0);
1317113172
}
1317213173
}
13174+
13175+
public global::CppSharp.Parser.AST.QualifiedType Type
13176+
{
13177+
get
13178+
{
13179+
return global::CppSharp.Parser.AST.QualifiedType.__CreateInstance(new __IntPtr(&((__Internal*)__Instance)->type));
13180+
}
13181+
13182+
set
13183+
{
13184+
if (ReferenceEquals(value, null))
13185+
throw new global::System.ArgumentNullException("value", "Cannot be null because it is passed by value.");
13186+
((__Internal*)__Instance)->type = *(global::CppSharp.Parser.AST.QualifiedType.__Internal*) value.__Instance;
13187+
}
13188+
}
1317313189
}
1317413190

1317513191
public unsafe partial class ClassTemplate : global::CppSharp.Parser.AST.Template, IDisposable

src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13018,6 +13018,7 @@ public unsafe partial class NonTypeTemplateParameter : global::CppSharp.Parser.A
1301813018
internal uint position;
1301913019
internal byte isPackExpansion;
1302013020
internal byte isExpandedParameterPack;
13021+
internal global::CppSharp.Parser.AST.QualifiedType.__Internal type;
1302113022

1302213023
[SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "??0NonTypeTemplateParameter@AST@CppParser@CppSharp@@QEAA@XZ", CallingConvention = __CallingConvention.Cdecl)]
1302313024
internal static extern __IntPtr ctor(__IntPtr __instance);
@@ -13172,6 +13173,21 @@ public bool IsExpandedParameterPack
1317213173
((__Internal*)__Instance)->isExpandedParameterPack = (byte) (value ? 1 : 0);
1317313174
}
1317413175
}
13176+
13177+
public global::CppSharp.Parser.AST.QualifiedType Type
13178+
{
13179+
get
13180+
{
13181+
return global::CppSharp.Parser.AST.QualifiedType.__CreateInstance(new __IntPtr(&((__Internal*)__Instance)->type));
13182+
}
13183+
13184+
set
13185+
{
13186+
if (ReferenceEquals(value, null))
13187+
throw new global::System.ArgumentNullException("value", "Cannot be null because it is passed by value.");
13188+
((__Internal*)__Instance)->type = *(global::CppSharp.Parser.AST.QualifiedType.__Internal*) value.__Instance;
13189+
}
13190+
}
1317513191
}
1317613192

1317713193
public unsafe partial class ClassTemplate : global::CppSharp.Parser.AST.Template, IDisposable

0 commit comments

Comments
 (0)