@@ -55,9 +55,10 @@ struct StoredDiagnosticInfo {
55
55
bool pointsToFirstBadToken : 1 ;
56
56
bool isFatal : 1 ;
57
57
58
- StoredDiagnosticInfo (DiagnosticKind k, bool firstBadToken, bool fatal)
58
+ constexpr StoredDiagnosticInfo (DiagnosticKind k, bool firstBadToken,
59
+ bool fatal)
59
60
: kind(k), pointsToFirstBadToken(firstBadToken), isFatal(fatal) {}
60
- StoredDiagnosticInfo (DiagnosticKind k, DiagnosticOptions opts)
61
+ constexpr StoredDiagnosticInfo (DiagnosticKind k, DiagnosticOptions opts)
61
62
: StoredDiagnosticInfo(k,
62
63
opts == DiagnosticOptions::PointsToFirstBadToken,
63
64
opts == DiagnosticOptions::Fatal) {}
@@ -73,7 +74,7 @@ enum LocalDiagID : uint32_t {
73
74
} // end anonymous namespace
74
75
75
76
// TODO: categorization
76
- static StoredDiagnosticInfo storedDiagnosticInfos[] = {
77
+ static const constexpr StoredDiagnosticInfo storedDiagnosticInfos[] = {
77
78
#define ERROR (ID, Options, Text, Signature ) \
78
79
StoredDiagnosticInfo (DiagnosticKind::Error, DiagnosticOptions::Options),
79
80
#define WARNING (ID, Options, Text, Signature ) \
@@ -88,7 +89,7 @@ static_assert(sizeof(storedDiagnosticInfos) / sizeof(StoredDiagnosticInfo) ==
88
89
LocalDiagID::NumDiags,
89
90
"array size mismatch");
90
91
91
- static const char *diagnosticStrings[] = {
92
+ static constexpr const char * const diagnosticStrings[] = {
92
93
#define ERROR (ID, Options, Text, Signature ) Text,
93
94
#define WARNING (ID, Options, Text, Signature ) Text,
94
95
#define NOTE (ID, Options, Text, Signature ) Text,
0 commit comments