[Issue 18859] New: Silence class allocator/deallocator deprecation warning if they are marked "deprecated"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon May 14 22:14:06 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18859
Issue ID: 18859
Summary: Silence class allocator/deallocator deprecation
warning if they are marked "deprecated"
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dlang-bugzilla at thecybershadow.net
To facilitate transition from class allocators/deallocators, it would be nice
if it was possible to mark them as deprecated, which would move the deprecation
warning from the declaration to any code that uses them. This would be similar
to how deprecated unittests allow silently testing deprecated symbols.
Example:
////////////// test.d /////////////
class C
{
new(size_t sz) { return null; }
}
void fun()
{
new C;
}
///////////////////////////////////
Currently, this warns on line 3.
/////////////////// test.d ///////////////////
class C
{
deprecated new(size_t sz) { return null; }
}
void fun()
{
new C;
}
//////////////////////////////////////////////
This warns both on line 3 and line 8 (usage).
It would be better to just have a warning at line 8.
--
More information about the Digitalmars-d-bugs
mailing list