Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/CppAst/CppModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,8 @@ private CppFunction VisitFunctionDecl(CXCursor cursor, CXCursor parent, void* da
var argName = CXUtil.GetCursorSpelling(argCursor);

var parameter = new CppParameter(GetCppType(argCursor.Type.Declaration, argCursor.Type, argCursor, clientData), argName);

ParseAttributes(argCursor, parameter, true);

cppFunction.Parameters.Add(parameter);

// Visit default parameter value
Expand Down
16 changes: 15 additions & 1 deletion src/CppAst/CppParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// See license.txt file in the project root for full license information.

using System;
using System.Collections.Generic;

namespace CppAst
{
/// <summary>
/// A C++ function parameter.
/// </summary>
public sealed class CppParameter : CppDeclaration, ICppMember
public sealed class CppParameter : CppDeclaration, ICppMember, ICppAttributeContainer
{
/// <summary>
/// Creates a new instance of a C++ function parameter.
Expand All @@ -20,6 +21,8 @@ public CppParameter(CppType type, string name)
{
Type = type ?? throw new ArgumentNullException(nameof(type));
Name = name ?? throw new ArgumentNullException(nameof(name));
Attributes = new List<CppAttribute>();
TokenAttributes = new List<CppAttribute>();
}

/// <summary>
Expand All @@ -41,6 +44,17 @@ public CppParameter(CppType type, string name)
/// Gets or sets the default value as an expression.
/// </summary>
public CppExpression InitExpression { get; set; }

/// <summary>
/// Gets the attached attributes.
/// </summary>
public List<CppAttribute> Attributes { get; }


[Obsolete("TokenAttributes is deprecated. please use system attributes and annotate attributes")]
public List<CppAttribute> TokenAttributes { get; }

public MetaAttributeMap MetaAttributes { get; }

public override string ToString()
{
Expand Down