Skip to content

Commit 49f0a18

Browse files
committed
Switch to attribute deprecated
1 parent af8abb5 commit 49f0a18

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
@@ -111,41 +111,36 @@ class StringSwitch {
111111
return CasesImpl(Value, {S0, S1, S2, S3, S4});
112112
}
113113

114-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
115-
"Cases({S0, S1, ...}, Value)")
114+
[[deprecated("Pass cases in std::initializer_list instead")]]
116115
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
117116
StringLiteral S3, StringLiteral S4, StringLiteral S5,
118117
T Value) {
119118
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5});
120119
}
121120

122-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
123-
"Cases({S0, S1, ...}, Value)")
121+
[[deprecated("Pass cases in std::initializer_list instead")]]
124122
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
125123
StringLiteral S3, StringLiteral S4, StringLiteral S5,
126124
StringLiteral S6, T Value) {
127125
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5, S6});
128126
}
129127

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

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

147-
LLVM_DEPRECATED("Pass cases in std::initializer_list instead",
148-
"Cases({S0, S1, ...}, Value)")
143+
[[deprecated("Pass cases in std::initializer_list instead")]]
149144
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
150145
StringLiteral S3, StringLiteral S4, StringLiteral S5,
151146
StringLiteral S6, StringLiteral S7, StringLiteral S8,

0 commit comments

Comments
 (0)