[llvm-bugs] [Bug 40874] New: -Wextra-semi shouldn't report semicolons in macros entirely in system headers

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 26 11:17:26 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40874

            Bug ID: 40874
           Summary: -Wextra-semi shouldn't report semicolons in macros
                    entirely in system headers
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Consider this ATL code:

thakis at thakis:~/src/chrome/src$ cat test.cc
#include <atlbase.h>
#include <atlcom.h>

class __declspec(uuid("00000000-0000-0000-c000-000000000046"))
    GaiaCredentialProvider {};

EXTERN_C const CLSID CLSID_GaiaCredentialProvider;

class CGaiaCredentialProvider
    : public CComObjectRootEx<CComMultiThreadModel>,
      public CComCoClass<CGaiaCredentialProvider,
                         &CLSID_GaiaCredentialProvider> {
 public:
  DECLARE_NO_REGISTRY()

  BEGIN_COM_MAP(CGaiaCredentialProvider)
  END_COM_MAP()
};

OBJECT_ENTRY_AUTO(__uuidof(GaiaCredentialProvider), CGaiaCredentialProvider)

thakis at thakis:~/src/chrome/src$
third_party/llvm-build/Release+Asserts/bin/clang-cl -c test.cc -imsvc
third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include
-imsvc
third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/ucrt/
-imsvc
third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/include/
-imsvc
third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/um
-imsvc
third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/shared/
-Wextra-semi
test.cc(20,1):  warning: extra ';' outside of a function is incompatible with
C++98 [-Wc++98-compat-extra-semi]
OBJECT_ENTRY_AUTO(__uuidof(GaiaCredentialProvider), CGaiaCredentialProvider)
^
third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include/atlcom.h(2407,2):
 note: 
      expanded from macro 'OBJECT_ENTRY_AUTO'
        OBJECT_ENTRY_PRAGMA(class)
        ^
third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include/atlcom.h(2396,91):
 note: 
      expanded from macro 'OBJECT_ENTRY_PRAGMA'
#define OBJECT_ENTRY_PRAGMA(class) __pragma(comment(linker,
"/include:__pobjMap_" #class));
                                                                               
          ^
1 warning generated.





-Wextra-semi complains about this, even though no part of the macro expansion
that adds the extra semicolon is in user code. clang shouldn't emit
-Wextra-semi for semicolons are 100% in system headers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190226/422a2637/attachment-0001.html>


More information about the llvm-bugs mailing list