[Issue 13294] [IFTI] IFTI fails or works incorrectly for function with const and mutable `ref` parameters of most types
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Aug 15 05:38:23 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13294
Denis Shelomovskij <verylonglogin.reg at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Summary|[IFTI] IFTI fails for |[IFTI] IFTI fails or works
|function with const and |incorrectly for function
|mutable `ref` parameters of |with const and mutable
|`[u]byte`/`[u]short` |`ref` parameters of most
| |types
--- Comment #1 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
It's not just these four integral types. For most other types `const` is
incorrectly added. This code should compile fine:
---
void f(T)(const ref T src, ref T dest) // T is const char here
{
static assert(!is(T == const)); // fails
}
void main()
{
const char src;
char dest;
f(src, dest);
}
---
Note: static assert passes for `int`/`uint`/`long`/`ulong` and floating point
types.
--
More information about the Digitalmars-d-bugs
mailing list