From b22a90eb9ee6fe911fabac18c2489119b948e8e8 Mon Sep 17 00:00:00 2001 From: Andrej Mitrovic Date: Fri, 25 Jan 2013 19:44:16 +0100 Subject: [PATCH] Fixes Issue 9336 - Format should work on shared address. --- std/format.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/std/format.d b/std/format.d index d181036c8..f9e992e51 100644 --- a/std/format.d +++ b/std/format.d @@ -2842,7 +2842,7 @@ if (isPointer!T && !is(T == enum) && !hasToString!(T, Char)) } else { - const void * p = val; + const p = val; if (f.spec == 's') { FormatSpec!Char fs = f; // fs is copy for change its values. @@ -2899,6 +2899,12 @@ unittest formatTest( B.init, "null" ); } +unittest +{ + // Test for issue 9336 + shared int i; + format("%s", &i); +} /** Delegates are formatted by 'Attributes ReturnType delegate(Parameters)'