[PATCH] [Modules] Teach Clang to survive ambiguous macros which come from system headers even if they arrived when merging non-system modules.

Chandler Carruth chandlerc at gmail.com
Thu Mar 12 20:06:47 PDT 2015


Hi rsmith,

The idea of this code is that we don't want to warn the user about
macros defined multiple times by their system headers with slightly
different definitions. We should have this behavior if either the
macro comes from a system module, or the definition within the module
comes from a system header. Previously, we would warn on ambiguous
macros being merged when they came from a users modules even though they
only showed up via system headers.

By surviving this we can handle common system header macro differences
like differing 'const' qualification of pointers due to some headers
predating 'const' being valid in C code, even when those systems headers
are pre-built into a system module.

http://reviews.llvm.org/D8310

Files:
  lib/Serialization/ASTReader.cpp
  test/Modules/Inputs/macro-ambiguity/a/foo.h
  test/Modules/Inputs/macro-ambiguity/b/foo.h
  test/Modules/Inputs/macro-ambiguity/c/bar.h
  test/Modules/Inputs/macro-ambiguity/c/d/baz.h
  test/Modules/Inputs/macro-ambiguity/module.modulemap
  test/Modules/macro-ambiguity.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8310.21893.patch
Type: text/x-patch
Size: 4071 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150313/84678887/attachment.bin>


More information about the cfe-commits mailing list