-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Full name of submitter (unless configured in github; will be published with the issue): Jiang An
Reference (section label): [expr.new]
Link to reflector thread (if any):
Issue description:
[expr.new] p29 currently says
If the lookup finds a single matching deallocation function, that function will be called; otherwise, no deallocation function will be called.
When there're more than one potentially matching deallocation functions, some resolution are done in [temp.deduct.decl] p2 and [temp.func.order] p1.3.
However, the following cases don't seem covered:
- one overload is a non-template function and the other is a function template specialization, and
- both overloads are non-template static member functions of a templated class and one is more constrained than the other.
Perhaps we should apply some rules from [over.match.best.general] for selection of deallocation functions.
Currently there's implementation divergence. GCC and MSVC think a non-template deallocation function overload is better than a template specialization, while Clang doesn't (demo).
Suggested resolution: