]> granicus.if.org Git - clang/commitdiff
Check for unavailable declarations in Sema::CanUseDecl.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Sun, 16 Oct 2011 18:19:16 +0000 (18:19 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Sun, 16 Oct 2011 18:19:16 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142145 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 79db724f1acef9f5c96afaca59a66766eeeb91df..0a0009e60215a24e1c65cd88321ef0aaa8611b18 100644 (file)
@@ -53,6 +53,12 @@ bool Sema::CanUseDecl(NamedDecl *D) {
     if (FD->isDeleted())
       return false;
   }
+
+  // See if this function is unavailable.
+  if (D->getAvailability() == AR_Unavailable &&
+      cast<Decl>(CurContext)->getAvailability() != AR_Unavailable)
+    return false;
+
   return true;
 }