Skip to content

Commit 964ede0

Browse files
committed
address feedback
1 parent c1be3c5 commit 964ede0

File tree

4 files changed

+30
-9
lines changed

4 files changed

+30
-9
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ Bug Fixes to Attribute Support
586586
``__attribute__((unused))`` are still ignored after the definition, though
587587
this behavior may be relaxed in the future). (#GH135481)
588588

589-
- Clang will warn if a completete type specializes a deprecated partial specialization.
589+
- Clang will warn if a complete type specializes a deprecated partial specialization.
590590
(#GH44496)
591591

592592
Bug Fixes to C++ Support

clang/include/clang/Sema/Sema.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,12 +2385,13 @@ class Sema final : public SemaBase {
23852385
/// potential availability violations.
23862386
sema::FunctionScopeInfo *getCurFunctionAvailabilityContext();
23872387

2388-
void DiagnoseAvailabilityOfDecl(
2389-
NamedDecl *D, ArrayRef<SourceLocation> Locs,
2390-
const ObjCInterfaceDecl *UnknownObjCClass = nullptr,
2391-
bool ObjCPropertyAccess = false,
2392-
bool AvoidPartialAvailabilityChecks = false,
2393-
ObjCInterfaceDecl *ClassReceiver = nullptr);
2388+
void DiagnoseAvailabilityOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs,
2389+
const ObjCInterfaceDecl *UnknownObjCClass,
2390+
bool ObjCPropertyAccess,
2391+
bool AvoidPartialAvailabilityChecks,
2392+
ObjCInterfaceDecl *ClassReceiver);
2393+
2394+
void DiagnoseAvailabilityOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs);
23942395

23952396
std::pair<AvailabilityResult, const NamedDecl *>
23962397
ShouldDiagnoseAvailabilityOfDecl(const NamedDecl *D, std::string *Message,

clang/lib/Sema/SemaAvailability.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,3 +1145,11 @@ void Sema::DiagnoseAvailabilityOfDecl(NamedDecl *D,
11451145
EmitAvailabilityWarning(*this, Result, D, OffendingDecl, Message, Locs,
11461146
UnknownObjCClass, ObjCPDecl, ObjCPropertyAccess);
11471147
}
1148+
1149+
void Sema::DiagnoseAvailabilityOfDecl(NamedDecl *D,
1150+
ArrayRef<SourceLocation> Locs) {
1151+
DiagnoseAvailabilityOfDecl(D, Locs, /*UnknownObjCClass=*/nullptr,
1152+
/*ObjCPropertyAccess=*/false,
1153+
/*AvoidPartialAvailabilityChecks=*/false,
1154+
/*ClassReceiver=*/nullptr);
1155+
}

clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,20 @@ template struct B<A>; // expected-note {{requested here}}
7575

7676

7777
namespace GH44496 {
78-
template <class> struct my_template {
79-
using type = void;
78+
79+
80+
template <typename T>
81+
class function { };
82+
template <typename A>
83+
class __attribute__((deprecated)) function<void(A)> { };
84+
// expected-note@-1 {{'function<void (int)>' has been explicitly marked deprecated here}}
85+
86+
void test() {
87+
[[maybe_unused]] function<void(int)> f; // expected-warning{{'function<void (int)>' is deprecated}}
88+
}
89+
90+
template <class> struct my_template {
91+
using type = void;
8092
};
8193

8294
template <class T>

0 commit comments

Comments
 (0)