Go to file
Duncan P. N. Exon Smith 8536392a83 Sema: Methods in unavailable classes are unavailable
Similar to the template cases in r262050, when a C++ method in an
unavailable struct/class calls unavailable API, don't diagnose an error.
I.e., this case was failing:

    void foo() __attribute__((unavailable));
    struct __attribute__((unavailable)) A {
      void bar() { foo(); }
    };

Since A is unavailable, A::bar is allowed to call foo.  However, we were
emitting a diagnostic here.  This commit checks up the context chain
from A::bar, in a manner inspired by SemaDeclAttr.cpp:isDeclUnavailable.

I expected to find other related issues but failed to trigger them:

- I wondered if DeclBase::getAvailability should check for
  `TemplateDecl` instead of `FunctionTemplateDecl`, but I couldn't find
  a way to trigger this.  I left behind a few extra tests to make sure
  we don't regress.

- I wondered if Sema::isFunctionConsideredUnavailable should be
  symmetric, checking up the context chain of the callee (this commit
  only checks up the context chain of the caller).  However, I couldn't
  think of a testcase that didn't require first referencing the
  unavailable type; this, we already diagnose.

rdar://problem/25030656

llvm-svn: 262921
2016-03-08 10:28:52 +00:00
clang Sema: Methods in unavailable classes are unavailable 2016-03-08 10:28:52 +00:00
clang-tools-extra [docs] Clean up doxygen comments a bit. 2016-03-06 04:05:59 +00:00
compiler-rt [sanitizer-common] Use @LINE in test. 2016-03-07 13:44:20 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc math: Fix ilogb(double) return type 2016-02-24 00:52:15 +00:00
libcxx Implement P0025R0: 'An algorithm to clamp a value between a pair of boundary values' for C++17 2016-03-07 22:43:49 +00:00
libcxxabi Reducing stack usage of test 2016-03-04 14:25:13 +00:00
libunwind [AArch64] Fix libunwind build when using GNU assembler 2016-02-11 21:22:57 +00:00
lld ELF: Rename NoInhibitExec -> NoinhibitExec. 2016-03-08 04:06:29 +00:00
lldb Use c_str() instead of GetCString() to fix build 2016-03-08 10:03:23 +00:00
llgo [llgo] Force exporting __morestack from llgoi 2015-11-27 04:46:46 +00:00
llvm [X86] Regenerated vector float extension tests 2016-03-08 09:17:12 +00:00
openmp [STATS] fix output formatting when sample count is 0 2016-03-03 21:24:13 +00:00
polly Also clang-format *.c run-time library files 2016-03-08 07:34:58 +00:00