Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1073 from 9rnsr/fix9317

Issue 9317 - ParameterStorageClassTuple reports errors for inout function
  • Loading branch information...
commit afe4ba151d673fa2d115922bad016c163789e55c 2 parents 248aaea + dd42a75
Alex Rønne Petersen alexrp authored

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 std/traits.d
7 std/traits.d
@@ -92,7 +92,8 @@ private
92 92
93 93 // FuncAttrs --> FuncAttr | FuncAttr FuncAttrs
94 94 // FuncAttr --> empty | Na | Nb | Nc | Nd | Ne | Nf
95   - while (mstr.length >= 2 && mstr[0] == 'N')
  95 + // except 'Ng' == inout, because it is a qualifier of function type
  96 + while (mstr.length >= 2 && mstr[0] == 'N' && mstr[1] != 'g')
96 97 {
97 98 if (FunctionAttribute att = LOOKUP_ATTRIBUTE[ mstr[1] ])
98 99 {
@@ -516,6 +517,10 @@ unittest
516 517 alias ParameterStorageClassTuple!((ref int a) {}) dglit_pstc;
517 518 static assert(dglit_pstc.length == 1);
518 519 static assert(dglit_pstc[0] == STC.ref_);
  520 +
  521 + // Bugzilla 9317
  522 + static inout int func(inout int param) { return param; }
  523 + static assert(ParameterStorageClassTuple!(typeof(func))[0] == STC.none);
519 524 }
520 525
521 526

0 comments on commit afe4ba1

Please sign in to comment.
Something went wrong with that request. Please try again.