Created on 2018-03-16.00:00:00 last changed 78 months ago
Proposed resolution:
This wording is relative to N4727.
Edit [new.delete.single] as indicated:
void operator delete(void* ptr) noexcept; void operator delete(void* ptr, std::size_t size) noexcept; void operator delete(void* ptr, std::align_val_t alignment) noexcept; void operator delete(void* ptr, std::size_t size, std::align_val_t alignment) noexcept;-10- Effects: […]
-11- Replaceable: A C++ program may define functions with any of these function signatures, and thereby displace the default versions defined by the C++ standard library. If a function without a size parameter is defined, the program should also define the corresponding function with a size parameter. If a function with a size parameter is defined, the program shall also define the corresponding version without the size parameter; no diagnostic is required. [Note: The default behavior below may change in the future, which will require replacing both deallocation functions when replacing the allocation function. — end note]
Edit [new.delete.array] as indicated:
void operator delete[](void* ptr) noexcept; void operator delete[](void* ptr, std::size_t size) noexcept; void operator delete[](void* ptr, std::align_val_t alignment) noexcept; void operator delete[](void* ptr, std::size_t size, std::align_val_t alignment) noexcept;-9- Effects: […]
-10- Replaceable: A C++ program may define functions with any of these function signatures, and thereby displace the default versions defined by the C++ standard library. If a function without a size parameter is defined, the program should also define the corresponding function with a size parameter. If a function with a size parameter is defined, the program shall also define the corresponding version without the size parameter; no diagnostic is required. [Note: The default behavior below may change in the future, which will require replacing both deallocation functions when replacing the allocation function. — end note]
[ 2018-06-18 after reflector discussion ]
Priority set to 3
[ 2018-04-03; Thomas Köppe and Tim Song suggest wording ]
In general requirements on a whole program, as opposed to a single translation unit, generally specify "no diagnostic required", since we don't want to require implementations to do multi-translation-unit analysis. However, [new.delete.single] paragraph 11 says,
If a function with a size parameter is defined, the program shall also define the corresponding version without the size parameter.
This is clearly not restricted to a single translation unit; should "no diagnostic required" be added?
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-06-19 05:49:11 | admin | set | messages: + msg9934 |
2018-04-03 19:17:52 | admin | set | messages: + msg9801 |
2018-04-03 19:17:52 | admin | set | messages: + msg9800 |
2018-03-16 00:00:00 | admin | create |