forked from OSchip/llvm-project
Push implicitly-declared allocation functions into the IdResolver. Otherwise,
declaration merging in modules is unable to find them and we get bogus errors and even crashes. llvm-svn: 208944
This commit is contained in:
parent
ee390436b9
commit
debcd500a0
|
@ -2109,10 +2109,8 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
|
|||
}
|
||||
Alloc->setParams(ArrayRef<ParmVarDecl*>(ParamDecls, NumParams));
|
||||
|
||||
// FIXME: Also add this declaration to the IdentifierResolver, but
|
||||
// make sure it is at the end of the chain to coincide with the
|
||||
// global scope.
|
||||
Context.getTranslationUnitDecl()->addDecl(Alloc);
|
||||
IdResolver.tryAddTopLevelDecl(Alloc, Name);
|
||||
}
|
||||
|
||||
FunctionDecl *Sema::FindUsualDeallocationFunction(SourceLocation StartLoc,
|
||||
|
|
|
@ -18,3 +18,5 @@ private:
|
|||
|
||||
static_assert(!__is_trivial(HasNontrivialDefaultConstructor), "");
|
||||
static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), "");
|
||||
|
||||
void *operator new[](__SIZE_TYPE__);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
// expected-no-diagnostics
|
||||
|
||||
void use_implicit_new() { operator new[](3); }
|
||||
|
||||
@import dummy;
|
||||
@import cxx_decls.imported;
|
||||
|
||||
|
@ -22,3 +24,5 @@ void test_friends(HasFriends s) {
|
|||
|
||||
static_assert(!__is_trivial(HasNontrivialDefaultConstructor), "");
|
||||
static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), "");
|
||||
|
||||
void use_implicit_new_again() { operator new[](3); }
|
||||
|
|
Loading…
Reference in New Issue