@@ -273,16 +273,16 @@ static llvm::raw_ostream::Colors PrefixColor(Severity severity) {
273273}
274274
275275// TODO: Make these configurable, based on verbosity level.
276- const int MAX_CONTEXTS_EMITTED = 2 ;
277- const bool OMIT_SHARED_CONTEXTS = true ;
276+ static constexpr int MAX_CONTEXTS_EMITTED{ 2 } ;
277+ static constexpr bool OMIT_SHARED_CONTEXTS{ true } ;
278278
279279void Message::Emit (llvm::raw_ostream &o, const AllCookedSources &allCooked,
280280 bool echoSourceLine) const {
281281 std::optional<ProvenanceRange> provenanceRange{GetProvenanceRange (allCooked)};
282282 const AllSources &sources{allCooked.allSources ()};
283283 sources.EmitMessage (o, provenanceRange, ToString (), Prefix (severity ()),
284284 PrefixColor (severity ()), echoSourceLine);
285- // Always refers to if the attachment in the loop below is a context.
285+ // Always refers to whether the attachment in the loop below is a context.
286286 bool isContext{attachmentIsContext_};
287287 int contextsEmitted{0 };
288288 // Emit attachments.
@@ -300,9 +300,9 @@ void Message::Emit(llvm::raw_ostream &o, const AllCookedSources &allCooked,
300300 // Truncate the number of contexts emitted.
301301 if (contextsEmitted < MAX_CONTEXTS_EMITTED) {
302302 emitAttachment ();
303- contextsEmitted += 1 ;
303+ ++contextsEmitted ;
304304 }
305- if (OMIT_SHARED_CONTEXTS) {
305+ if constexpr (OMIT_SHARED_CONTEXTS) {
306306 // Skip less specific contexts at the same location.
307307 for (const Message *next_attachment{attachment->attachment_ .get ()};
308308 next_attachment && next_attachment->attachmentIsContext_ &&
0 commit comments