зеркало из https://github.com/microsoft/clang-1.git
Return true on errors, return true on errors, return true on errors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64957 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2701900189
Коммит
c2b6a82393
|
@ -660,7 +660,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
|
|||
Diag(New->getLocation(), diag::warn_redecl_library_builtin) << New;
|
||||
Diag(Old->getLocation(), diag::note_previous_builtin_declaration)
|
||||
<< Old << Old->getType();
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
PrevDiag = diag::note_previous_builtin_declaration;
|
||||
|
|
|
@ -5,3 +5,10 @@ static void* malloc(int);
|
|||
static void* malloc(int size) {
|
||||
return ((void*)0); /*do not use heap in this file*/
|
||||
}
|
||||
|
||||
void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc' will be ignored}} \
|
||||
// expected-note{{'calloc' is a builtin with type 'void *(unsigned long, unsigned long)'}}
|
||||
|
||||
void f1(void) {
|
||||
return calloc(0, 0, 0); // expected-error{{too many arguments to function call}}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче