]> granicus.if.org Git - clang/commit
[Modules] Teach Clang to survive ambiguous macros which come from system
authorChandler Carruth <chandlerc@gmail.com>
Fri, 13 Mar 2015 08:29:54 +0000 (08:29 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 13 Mar 2015 08:29:54 +0000 (08:29 +0000)
commit73f9bb0a17bbc46701c3f86bb412b562047aeb83
treeb09abcfdaf704ae957cc351c71fc00ceed756dd3
parentfdd9dfb4437a55812de0aed9cc8e0e01b42d9030
[Modules] Teach Clang to survive ambiguous macros which come from system
headers even if they arrived when merging non-system modules.

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.

Differential Revision: http://reviews.llvm.org/D8310

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232149 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
lib/Serialization/ASTReader.cpp
test/Modules/Inputs/macro-ambiguity/a/quote/a_quote.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/a/system/a_system.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/b/quote/b_quote.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/b/system/b_system.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/c/quote/c_quote.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/c/system/c_system.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/d/quote/d_quote.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/d/system/d_system.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/e/quote/e_quote.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/e/system/e_system.h [new file with mode: 0644]
test/Modules/Inputs/macro-ambiguity/module.modulemap [new file with mode: 0644]
test/Modules/macro-ambiguity.cpp [new file with mode: 0644]