Suppress diagnostics during name lookup for absolute value type.

llvm-svn: 203061
This commit is contained in:
Richard Trieu 2014-03-06 02:25:04 +00:00
parent bc46f3c15d
commit fe771c071a
2 changed files with 14 additions and 0 deletions

View File

@ -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.

View File

@ -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}}
}