forked from OSchip/llvm-project
Look through using declarations when searching for allocation overloads.
llvm-svn: 90961
This commit is contained in:
parent
07df9efb35
commit
c50b340108
clang
|
@ -601,7 +601,8 @@ bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range,
|
|||
Alloc != AllocEnd; ++Alloc) {
|
||||
// Even member operator new/delete are implicitly treated as
|
||||
// static, so don't use AddMemberCandidate.
|
||||
if (FunctionDecl *Fn = dyn_cast<FunctionDecl>(*Alloc)) {
|
||||
if (FunctionDecl *Fn =
|
||||
dyn_cast<FunctionDecl>((*Alloc)->getUnderlyingDecl())) {
|
||||
AddOverloadCandidate(Fn, Args, NumArgs, Candidates,
|
||||
/*SuppressUserConversions=*/false);
|
||||
continue;
|
||||
|
|
|
@ -202,3 +202,17 @@ struct X11 : X10 { // expected-error {{no suitable member 'operator delete' in '
|
|||
void f() {
|
||||
X11 x11; // expected-note {{implicit default destructor for 'struct X11' first required here}}
|
||||
}
|
||||
|
||||
struct X12 {
|
||||
void* operator new(size_t, void*);
|
||||
};
|
||||
|
||||
struct X13 : X12 {
|
||||
using X12::operator new;
|
||||
};
|
||||
|
||||
static void* f(void* g)
|
||||
{
|
||||
return new (g) X13();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue