Skip to content

Commit

Permalink
Merge pull request #1073 from 9rnsr/fix9317
Browse files Browse the repository at this point in the history
Issue 9317 - ParameterStorageClassTuple reports errors for inout function
  • Loading branch information
alexrp committed Jan 15, 2013
2 parents 248aaea + dd42a75 commit afe4ba1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion std/traits.d
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private


// FuncAttrs --> FuncAttr | FuncAttr FuncAttrs // FuncAttrs --> FuncAttr | FuncAttr FuncAttrs
// FuncAttr --> empty | Na | Nb | Nc | Nd | Ne | Nf // FuncAttr --> empty | Na | Nb | Nc | Nd | Ne | Nf
while (mstr.length >= 2 && mstr[0] == 'N') // except 'Ng' == inout, because it is a qualifier of function type
while (mstr.length >= 2 && mstr[0] == 'N' && mstr[1] != 'g')
{ {
if (FunctionAttribute att = LOOKUP_ATTRIBUTE[ mstr[1] ]) if (FunctionAttribute att = LOOKUP_ATTRIBUTE[ mstr[1] ])
{ {
Expand Down Expand Up @@ -516,6 +517,10 @@ unittest
alias ParameterStorageClassTuple!((ref int a) {}) dglit_pstc; alias ParameterStorageClassTuple!((ref int a) {}) dglit_pstc;
static assert(dglit_pstc.length == 1); static assert(dglit_pstc.length == 1);
static assert(dglit_pstc[0] == STC.ref_); static assert(dglit_pstc[0] == STC.ref_);

// Bugzilla 9317
static inout int func(inout int param) { return param; }
static assert(ParameterStorageClassTuple!(typeof(func))[0] == STC.none);
} }




Expand Down

0 comments on commit afe4ba1

Please sign in to comment.