Index: cfe/trunk/docs/ReleaseNotes.rst =================================================================== --- cfe/trunk/docs/ReleaseNotes.rst +++ cfe/trunk/docs/ReleaseNotes.rst @@ -94,6 +94,9 @@ Attribute Changes in Clang -------------------------- +- The presence of __attribute__((availability(...))) on a declaration no longer + implies default visibility for that declaration on macOS. + - ... Windows Support Index: cfe/trunk/lib/AST/Decl.cpp =================================================================== --- cfe/trunk/lib/AST/Decl.cpp +++ cfe/trunk/lib/AST/Decl.cpp @@ -216,14 +216,6 @@ return getVisibilityFromAttr(A); } - // If we're on Mac OS X, an 'availability' for Mac OS X attribute - // implies visibility(default). - if (D->getASTContext().getTargetInfo().getTriple().isOSDarwin()) { - for (const auto *A : D->specific_attrs()) - if (A->getPlatform()->getName().equals("macos")) - return DefaultVisibility; - } - return None; } Index: cfe/trunk/test/CodeGen/attr-availability.c =================================================================== --- cfe/trunk/test/CodeGen/attr-availability.c +++ cfe/trunk/test/CodeGen/attr-availability.c @@ -8,9 +8,9 @@ void f2(); void f2() { } -// CHECK-10_4-LABEL: define void @f3 -// CHECK-10_5-LABEL: define void @f3 -// CHECK-10_6-LABEL: define void @f3 +// CHECK-10_4-LABEL: define hidden void @f3 +// CHECK-10_5-LABEL: define hidden void @f3 +// CHECK-10_6-LABEL: define hidden void @f3 void f3() __attribute__((availability(macosx,introduced=10.5))); void f3() { }