[Bug libstdc++/48631] New: [C++0x] default_delete<T[]> accepts pointer conversions in function call operator
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Fri Apr 15 19:56:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48631
Summary: [C++0x] default_delete<T[]> accepts pointer
conversions in function call operator
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
The following program using 4.7.0 20110409 (experimental) should be rejected,
but is accepted:
//------------
#include <memory>
struct B {};
struct D : B {};
int main() {
D d;
std::default_delete<B[]> db;
typedef decltype(db(&d)) type;
}
//------------
Reason for this deviation of the spec is the missing deleted function call
operator as described in [unique.ptr.dltr.dflt1]:
template <class T> struct default_delete<T[]> {
constexpr default_delete() noexcept = default;
void operator()(T*) const;
template <class U> void operator()(U*) const = delete;
};
More information about the Gcc-bugs
mailing list