<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;"><br><div><div>On Oct 31, 2014, at 4:28 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Thanks!<div><br></div><div>Here's an example where the method name isn't from a macro expansion, but it's still a macro argument. Could the warning be suppressed here too?</div></div></blockquote><div><br></div>In r<span style="font-family: Menlo; font-size: 11px;">221172.</span></div><div><font face="Menlo"><span style="font-size: 11px;">- Fariborz</span></font></div><div><font face="Menlo"><span style="font-size: 11px;"><br></span></font><blockquote type="cite"><div dir="ltr"><div><br></div><div><div>..\..\win8/metro_driver/chrome_app_view_ash.h(65,15) : warning(clang): 'Initialize' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]</div><div> IFACEMETHOD(Initialize)(winapp::Core::ICoreApplicationView* view);</div><div> ^</div><div>C:\b\depot_tools\win_toolchain\vs2013_files\win8sdk/Include/um\combaseapi.h(217,58) : note(clang): expanded from macro 'IFACEMETHOD'</div><div>#define IFACEMETHOD(method) __override STDMETHOD(method)</div><div> ^</div><div>C:\b\depot_tools\win_toolchain\vs2013_files\win8sdk/Include/um\combaseapi.h(205,89) : note(clang): expanded from macro 'STDMETHOD'</div><div>#define STDMETHOD(method) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE method</div><div> ^</div><div>C:\b\depot_tools\win_toolchain\vs2013_files\win8sdk/Include/winrt/Windows.ApplicationModel.Core.h(1179,59) : note(clang): overridden virtual function is here</div><div> virtual HRESULT STDMETHODCALLTYPE Initialize( </div><div> ^</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 31, 2014 at 12:56 PM, Fariborz Jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com" target="_blank">fjahanian@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: fjahanian<br>
Date: Fri Oct 31 14:56:27 2014<br>
New Revision: 220992<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=220992&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=220992&view=rev</a><br>
Log:<br>
C++-11 [qoi]. Do not warn on missing 'verride' on use of<br>
macros in user code when macros themselves are defined<br>
in a system header. <a href="rdar://18295240">rdar://18295240</a><br>
<br>
Added:<br>
cfe/trunk/test/SemaCXX/Inputs/override-system-header.h<br>
cfe/trunk/test/SemaCXX/override-in-system-header.cpp<br>
Modified:<br>
cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=220992&r1=220991&r2=220992&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=220992&r1=220991&r2=220992&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Oct 31 14:56:27 2014<br>
@@ -1905,6 +1905,12 @@ void Sema::DiagnoseAbsenceOfOverrideCont<br>
isa<CXXDestructorDecl>(MD))<br>
return;<br>
<br>
+ if (MD->getLocation().isMacroID()) {<br>
+ SourceLocation MacroLoc = getSourceManager().getSpellingLoc(MD->getLocation());<br>
+ if (getSourceManager().isInSystemHeader(MacroLoc))<br>
+ return;<br>
+ }<br>
+<br>
if (MD->size_overridden_methods() > 0) {<br>
Diag(MD->getLocation(), diag::warn_function_marked_not_override_overriding)<br>
<< MD->getDeclName();<br>
<br>
Added: cfe/trunk/test/SemaCXX/Inputs/override-system-header.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/Inputs/override-system-header.h?rev=220992&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/Inputs/override-system-header.h?rev=220992&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaCXX/Inputs/override-system-header.h (added)<br>
+++ cfe/trunk/test/SemaCXX/Inputs/override-system-header.h Fri Oct 31 14:56:27 2014<br>
@@ -0,0 +1,3 @@<br>
+// override-system-header.h to test out 'override' warning.<br>
+// <a href="rdar://18295240">rdar://18295240</a><br>
+#define END_COM_MAP virtual unsigned AddRef(void) = 0;<br>
<br>
Added: cfe/trunk/test/SemaCXX/override-in-system-header.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/override-in-system-header.cpp?rev=220992&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/override-in-system-header.cpp?rev=220992&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaCXX/override-in-system-header.cpp (added)<br>
+++ cfe/trunk/test/SemaCXX/override-in-system-header.cpp Fri Oct 31 14:56:27 2014<br>
@@ -0,0 +1,17 @@<br>
+// RUN: %clang_cc1 -std=c++11 -isystem %S/Inputs %s -verify<br>
+// expected-no-diagnostics<br>
+// <a href="rdar://18295240">rdar://18295240</a><br>
+<br>
+#include <override-system-header.h><br>
+<br>
+struct A<br>
+{<br>
+ virtual void x();<br>
+ END_COM_MAP;<br>
+};<br>
+<br>
+struct B : A<br>
+{<br>
+ virtual void x() override;<br>
+ END_COM_MAP;<br>
+};<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</blockquote></div><br></body></html>