We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af4bae4 commit aff2c87Copy full SHA for aff2c87
1 file changed
compiler/src/dmd/glue/tocsym.d
@@ -141,7 +141,7 @@ Symbol* toSymbol(Dsymbol s)
141
142
import dmd.common.outbuffer : OutBuffer;
143
OutBuffer buf;
144
- bool isNRVO = false;
+ bool isNRVO = vd.nrvo;
145
const(char)[] id = vd.ident.toString();
146
if (vd.isDataseg())
147
{
@@ -277,7 +277,16 @@ Symbol* toSymbol(Dsymbol s)
277
* dereferences.
278
*/
279
//printf("\tnested ref, not register\n");
280
- type_setcv(&t, t.Tty | mTYvolatile);
+ FuncDeclaration fd = vd.toParent2().isFuncDeclaration();
281
+ if (fd && vd.nrvo)
282
+ {
283
+ Symbol* shidden = cast(Symbol*)fd.shidden;
284
+ type_setcv(&shidden.Stype, shidden.Stype.Tty | mTYvolatile);
285
+ }
286
+ else
287
288
+ type_setcv(&t, t.Tty | mTYvolatile);
289
290
}
291
292
0 commit comments