Remove warning about shadowing a built-in; built-ins aren't actually
considered to be a part of the translation unit unless they're named
in a way that brings them into existence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98729 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index b2b4306..6e19051 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -113,8 +113,7 @@
           "local variable|"
           "variable in %2|"
           "static data member of %2|"
-          "field of %2|"
-          "global built-in function}1">,
+          "field of %2}1">,
   InGroup<Shadow>, DefaultIgnore;
 
 // C++ using declarations
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index f4b9cf4..d562a52 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2482,16 +2482,8 @@
   DeclarationName Name = D->getDeclName();
 
   // Return if lookup has no result.
-  if (R.getResultKind() != LookupResult::Found) {
-    // Emit warning for built-in shadowing.
-    if (Name.getAsIdentifierInfo() &&
-        Name.getAsIdentifierInfo()->getBuiltinID())
-      Diag(D->getLocation(), diag::warn_decl_shadow)
-        << Name
-        << 4 // global builtin
-        << Context.getTranslationUnitDecl();
+  if (R.getResultKind() != LookupResult::Found)
     return;
-  }
 
   // Return if not variable decl.
   NamedDecl* ShadowedDecl = R.getFoundDecl();
diff --git a/test/Sema/warn-shadow.c b/test/Sema/warn-shadow.c
index f75c140..dacf66d 100644
--- a/test/Sema/warn-shadow.c
+++ b/test/Sema/warn-shadow.c
@@ -16,5 +16,5 @@
     }
   }
 
-  int __sync_fetch_and_add; // expected-warning {{declaration shadows a global built-in function}}
+  int sin; // okay; 'sin' has not been declared, even though it's a builtin.
 }