http://llvm.org/bugs/show_bug.cgi?id=7436
Summary: Clang fails to select the correct operator delete for
access control check
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Is this even valid C++ code?
% cat t.cc
#include <cstdlib>
#include <new>
struct S {
void* operator new(std::size_t) throw(std::bad_alloc) {
return std::malloc(sizeof(S));
}
void operator delete(void* p) throw() {
std::free(p);
}
private:
void* operator new(std::size_t, const std::nothrow_t&) throw();
void* operator new(std::size_t, void*) throw();
void* operator new[](std::size_t) throw(std::bad_alloc);
void* operator new[](std::size_t, const std::nothrow_t&) throw();
void* operator new[](std::size_t, void*) throw();
void operator delete(void*, const std::nothrow_t&) throw();
void operator delete(void*, void*) throw();
void operator delete[](void* p) throw();
void operator delete[](void*, const std::nothrow_t&) throw();
void operator delete[](void*, void*) throw();
};
void test(S* s) { delete s; }
% clang -fsyntax-only t.cc
t.cc:26:19: error: 'operator delete' is a private member of 'S'
void test(S* s) { delete s; }
^
t.cc:19:8: note: declared private here
void operator delete(void*, const std::nothrow_t&) throw();
^
t.cc:26:19: error: 'operator delete' is a private member of 'S'
void test(S* s) { delete s; }
^
t.cc:20:8: note: declared private here
void operator delete(void*, void*) throw();
^
2 errors generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs