Permalink
Browse files

Merge pull request #1073 from 9rnsr/fix9317

Issue 9317 - ParameterStorageClassTuple reports errors for inout function
  • Loading branch information...
2 parents 248aaea + dd42a75 commit afe4ba151d673fa2d115922bad016c163789e55c @alexrp alexrp committed Jan 15, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 std/traits.d
View
@@ -92,7 +92,8 @@ private
// FuncAttrs --> FuncAttr | FuncAttr FuncAttrs
// 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] ])
{
@@ -516,6 +517,10 @@ unittest
alias ParameterStorageClassTuple!((ref int a) {}) dglit_pstc;
static assert(dglit_pstc.length == 1);
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);
}

0 comments on commit afe4ba1

Please sign in to comment.