Mercurial > projects > ddmd
diff dmd/SymOffExp.d @ 137:09c858522d55
merge
author | Trass3r |
---|---|
date | Mon, 13 Sep 2010 23:29:00 +0200 |
parents | af1bebfd96a4 |
children | af724d3510d7 |
line wrap: on
line diff
--- a/dmd/SymOffExp.d Mon Sep 13 23:27:38 2010 +0200 +++ b/dmd/SymOffExp.d Mon Sep 13 23:29:00 2010 +0200 @@ -20,6 +20,7 @@ import dmd.ErrorExp; import dmd.TY; import dmd.TOK; +import dmd.STC; import dmd.backend.Symbol; import dmd.backend.Util; @@ -58,14 +59,14 @@ VarDeclaration v = var.isVarDeclaration(); if (v) { - if (!v.isDataseg()) + if (!v.isDataseg() && !(v.storage_class & (STC.STCref | STC.STCout))) { /* BUG: This should be allowed: * void foo() * { int a; * int* bar() { return &a; } * } */ - error("escaping reference to local variable %s", v.toChars()); + error("escaping reference to local %s", v.toChars()); } } }