Skip to content

Commit e80bca1

Browse files
committed
Switch to attribute deprecated
1 parent 454493d commit e80bca1

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3629,18 +3629,19 @@ static FormatAttrKind getFormatAttrKind(StringRef Format) {
36293629
// Check for formats that get handled specially.
36303630
.Case("NSString", NSStringFormat)
36313631
.Case("CFString", CFStringFormat)
3632-
.Cases("gnu_strftime", "strftime", StrftimeFormat)
3632+
.Cases({"gnu_strftime", "strftime"}, StrftimeFormat)
36333633

36343634
// Otherwise, check for supported formats.
3635-
.Cases("gnu_scanf", "scanf", "gnu_printf", "printf", "printf0",
3635+
.Cases({"gnu_scanf", "scanf", "gnu_printf", "printf", "printf0"},
36363636
"gnu_strfmon", "strfmon", SupportedFormat)
3637-
.Cases("cmn_err", "vcmn_err", "zcmn_err", SupportedFormat)
3638-
.Cases("kprintf", "syslog", SupportedFormat) // OpenBSD.
3639-
.Case("freebsd_kprintf", SupportedFormat) // FreeBSD.
3637+
.Cases({"cmn_err", "vcmn_err", "zcmn_err"}, SupportedFormat)
3638+
.Cases({"kprintf", "syslog"}, SupportedFormat) // OpenBSD.
3639+
.Case("freebsd_kprintf", SupportedFormat) // FreeBSD.
36403640
.Case("os_trace", SupportedFormat)
36413641
.Case("os_log", SupportedFormat)
36423642

3643-
.Cases("gcc_diag", "gcc_cdiag", "gcc_cxxdiag", "gcc_tdiag", IgnoredFormat)
3643+
.Cases({"gcc_diag", "gcc_cdiag", "gcc_cxxdiag", "gcc_tdiag"},
3644+
IgnoredFormat)
36443645
.Default(InvalidFormat);
36453646
}
36463647

llvm/include/llvm/ADT/StringSwitch.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,41 +108,36 @@ class StringSwitch {
108108
return CasesImpl(Value, {S0, S1, S2, S3, S4});
109109
}
110110

111-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
112-
"Cases({S0, S1, ...}, Value)")
111+
[[deprecated("Pass cases in std::initializer_list instead")]]
113112
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
114113
StringLiteral S3, StringLiteral S4, StringLiteral S5,
115114
T Value) {
116115
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5});
117116
}
118117

119-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
120-
"Cases({S0, S1, ...}, Value)")
118+
[[deprecated("Pass cases in std::initializer_list instead")]]
121119
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
122120
StringLiteral S3, StringLiteral S4, StringLiteral S5,
123121
StringLiteral S6, T Value) {
124122
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5, S6});
125123
}
126124

127-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
128-
"Cases({S0, S1, ...}, Value)")
125+
[[deprecated("Pass cases in std::initializer_list instead")]]
129126
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
130127
StringLiteral S3, StringLiteral S4, StringLiteral S5,
131128
StringLiteral S6, StringLiteral S7, T Value) {
132129
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5, S6, S7});
133130
}
134131

135-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
136-
"Cases({S0, S1, ...}, Value)")
132+
[[deprecated("Pass cases in std::initializer_list instead")]]
137133
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
138134
StringLiteral S3, StringLiteral S4, StringLiteral S5,
139135
StringLiteral S6, StringLiteral S7, StringLiteral S8,
140136
T Value) {
141137
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5, S6, S7, S8});
142138
}
143139

144-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
145-
"Cases({S0, S1, ...}, Value)")
140+
[[deprecated("Pass cases in std::initializer_list instead")]]
146141
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
147142
StringLiteral S3, StringLiteral S4, StringLiteral S5,
148143
StringLiteral S6, StringLiteral S7, StringLiteral S8,

0 commit comments

Comments
 (0)