forked from OSchip/llvm-project
Suppress diagnostics during name lookup for absolute value type.
llvm-svn: 203061
This commit is contained in:
parent
bc46f3c15d
commit
fe771c071a
|
@ -3817,6 +3817,7 @@ static void emitReplacement(Sema &S, SourceLocation Loc, SourceRange Range,
|
|||
// Look up absolute value function in TU scope.
|
||||
DeclarationName DN(&S.Context.Idents.get(AbsName));
|
||||
LookupResult R(S, DN, Loc, Sema::LookupAnyName);
|
||||
R.suppressDiagnostics();
|
||||
S.LookupName(R, S.TUScope);
|
||||
|
||||
// Skip notes if multiple results found in lookup.
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -verify %s -Wabsolute-value
|
||||
|
||||
extern "C" {
|
||||
int abs(int);
|
||||
long labs(long);
|
||||
}
|
||||
|
||||
using ::labs;
|
||||
|
||||
long test(long x) {
|
||||
return ::abs(x);
|
||||
// expected-warning@-1{{using integer absolute value function 'abs' when argument is of floating point type}}
|
||||
}
|
Loading…
Reference in New Issue