<br><br><div class="gmail_quote">On Wed, Jun 1, 2011 at 4:33 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div class="im"><br><div><div>On May 29, 2011, at 1:51 PM, Richard Trieu wrote:</div><br><blockquote type="cite"><div><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px"><pre style="font-size:12px">
<span>Made changes to how 'struct'/'class' mismatches are handled.
- Removed fix-it hints from template instaniations since changes to the
templates are rarely helpful.
- Changed the caret in template instaniations from the class/struct name to the
class/struct keyword, matching the other warnings.
- Do not offer fix-it hints when multiple declarations disagree.  Warnings are
still given.
- Once a definition is found, offer a fix-it hint to all previous declarations
with wrong tag.
- Declarations that disagree with a previous definition will get a fix-it hint
to change the declaration.</span></pre></span></div></blockquote></div></div><div>I think this is great. I have one question:</div><div><br></div><div><div>+    if (isTemplate) {</div><div>+      Diag(NewTagLoc, diag::warn_struct_class_tag_mismatch)</div>
<div>+        << (NewTag == TTK_Class)</div><div>+        << isTemplate << &Name</div><div>+        << FixItHint::CreateReplacement(SourceRange(NewTagLoc),</div><div>+                                        OldTag == TTK_Class ?</div>
<div>+                                        "class" : "struct");</div><div>+      Diag(Previous->getLocation(), diag::note_previous_use);</div><div>+      return true;</div><div>+    }</div><div><br>
</div><div>Why do we bail out early for templates, rather than treating them the same way as non-templates?</div><div><br></div><div><span style="white-space:pre-wrap">      </span>- Doug</div></div><br></div></blockquote></div>
Not really.  I thought there was some issue with it earlier, but can't remember what it is now.  I'll test it out and see if there's any problems.