@@ -62,17 +62,6 @@ struct SwiftDiagnostic {
6262
6363 std::optional<SwiftDiagnosticsLocation> location{};
6464
65- // optional arguments can be either Severity or Visibility to set the corresponding field.
66- // TODO(C++20) this constructor won't really be necessary anymore with designated initializers
67- template <typename ... OptionalArgs>
68- constexpr SwiftDiagnostic (std::string_view id,
69- std::string_view name,
70- std::string_view action,
71- OptionalArgs... optionalArgs)
72- : id{id}, name{name}, action{action} {
73- (setOptionalArg (optionalArgs), ...);
74- }
75-
7665 // create a JSON diagnostics for this source with the given `timestamp` and Markdown `message`
7766 // A markdownMessage is emitted that includes both the message and the action to take. The id is
7867 // used to construct the source id in the form `swift/<prog name>/<id>`
@@ -94,13 +83,6 @@ struct SwiftDiagnostic {
9483
9584 private:
9685 bool has (Visibility v) const ;
97-
98- constexpr void setOptionalArg (Visibility v) { visibility = v; }
99- constexpr void setOptionalArg (Severity s) { severity = s; }
100-
101- // intentionally left undefined
102- template <typename T>
103- constexpr void setOptionalArg (T);
10486};
10587
10688inline constexpr SwiftDiagnostic::Visibility operator |(SwiftDiagnostic::Visibility lhs,
@@ -116,14 +98,15 @@ inline constexpr SwiftDiagnostic::Visibility operator&(SwiftDiagnostic::Visibili
11698}
11799
118100constexpr SwiftDiagnostic internalError{
119- " internal-error" ,
120- " Internal error" ,
121- " Some or all of the Swift analysis may have failed.\n "
122- " \n "
123- " If the error persists, contact support, quoting the error message and describing what "
124- " happened, or [open an issue in our open source repository][1].\n "
125- " \n "
126- " [1]: https://github.com/github/codeql/issues/new?labels=bug&template=ql---general.md" ,
127- SwiftDiagnostic::Severity::warning,
101+ .id = " internal-error" ,
102+ .name = " Internal error" ,
103+ .action =
104+ " Some or all of the Swift analysis may have failed.\n "
105+ " \n "
106+ " If the error persists, contact support, quoting the error message and describing what "
107+ " happened, or [open an issue in our open source repository][1].\n "
108+ " \n "
109+ " [1]: https://github.com/github/codeql/issues/new?labels=bug&template=ql---general.md" ,
110+ .severity = SwiftDiagnostic::Severity::warning,
128111};
129112} // namespace codeql
0 commit comments