<div>Index: lib/Sema/DeclSpec.cpp</div><div>===================================================================</div><div>--- lib/Sema/DeclSpec.cpp<span class="" style="white-space:pre">      </span>(revision 162690)</div><div>
+++ lib/Sema/DeclSpec.cpp<span class="" style="white-space:pre">      </span>(working copy)</div><div>@@ -325,10 +325,17 @@</div><div> </div><div> template <class T> static bool BadSpecifier(T TNew, T TPrev,</div><div>                                             const char *&PrevSpec,</div>
<div>-                                            unsigned &DiagID) {</div><div>+                                            unsigned &DiagID,</div><div>+                                            bool Pedantic = true) {</div>
<div><br></div><div>How about "IsExtension"?</div><div><br></div><div>   PrevSpec = DeclSpec::getSpecifierName(TPrev);</div><div>-  DiagID = (TNew == TPrev ? diag::ext_duplicate_declspec</div><div>-            : diag::err_invalid_decl_spec_combination);</div>
<div>+  if (TNew == TPrev) {</div><div>+    if (Pedantic)</div><div>+      DiagID = diag::ext_duplicate_declspec;</div><div>+    else</div><div>+      DiagID = diag::warn_duplicate_declspec;</div><div>+  } else {</div><div>
+    DiagID = diag::err_invalid_decl_spec_combination;</div><div>+  }</div><div><br></div><div>Would early exit make this cleaner?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 28, 2012 at 12:56 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Aug 28, 2012 at 3:06 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br>

> I'm a bit uncomfortable making this an ExtWarn in all cases, as it doesn't<br>
> seem like it should be controlled by -pedantic when it is pedantically well<br>
> formed code.<br>
><br>
> We should probably have two (yea, I know) diagnostics, one for when we<br>
> accept this an an extension, and one for when it is valid but likely<br>
> confusing / inadvisable. I'm happy for them to both be under the same<br>
> diagnostic group though.<br>
<br>
</div>Thank you for the feedback (and clarifications).  Here's a revised<br>
patch which splits this into two warnings.  One is an ExtWarn for when<br>
we pedantically allow the behavior.  The other is a vanilla Warning<br>
for when we don't pedantically allow the behavior.  Both are<br>
implemented under the same group.<br>
<br>
Thanks!<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span></blockquote></div><br></div>