<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>[+cfe-dev, -cfe-commits for the new "coding" convention]</div><div><br></div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, everyone. One thing that's bothered me about our diagnostic TableGen files is the anonymous use of warning groups:<div><br></div><div>def warn_foo : Warning<"foo is bad">, InGroup<DiagGroup<"foo">>;</div><div>def warn_foo_cxx : Warning<"foo is even worse in C++">, InGroup<DiagGroup<"foo">>;</div><div><br></div><div>If we ever want to put the warning groups in a hierarchy, or change the name, there's a big chance we'll miss one.</div><div><br></div><div>So, I wrote a new warning for clang-tblgen, which even has a fixit if the group already has a name:</div><div><br></div><div>warning: group 'foo' is referred to anonymously</div><div><font face="Courier">def warn_foo : Warning<"foo is bad">, InGroup<DiagGroup<"foo">>;</font></div><div><font face="Courier">                                      ~~~~~~~~^~~~~~~~~~~~~~~~~</font></div><div><font face="Courier">                                      InGroup<Foo></font></div><div><font face="Courier"><br></font></div><div>And then fixed all the warnings, with the intent that we make this a new style requirement going forwards: groups that cover more than one diagnostic must be named.</div></div></blockquote></div></div><div><br></div><div>Sean has suggested making this an error instead of a warning, since we go for a warning-free build anyway. I'm not sure why I thought a warning was preferable; we'd obviously make anyone fix their code before committing if they triggered the warning. The only thing I can think of is that it might be better for quick testing when transitioning from one diagnostic to another, or when trying out a new diagnostic under an existing flag.</div><div><br></div><div>Opinions? I'm fine either way.</div><div><br></div><div>Jordan</div></body></html>