]> granicus.if.org Git - clang/commit
[modules] Fix macro hiding bug exposed if:
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 18 Jul 2014 04:53:37 +0000 (04:53 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 18 Jul 2014 04:53:37 +0000 (04:53 +0000)
commitfdee4dcca3472941066cceb288fcb7c8f4856fa1
tree703268dcf40b8b3ec66b62598b9adde37553b25f
parente0eea0c6faf28d50c6e8f7ed5cf25ff0dd03f2cc
[modules] Fix macro hiding bug exposed if:

 * A submodule of module A is imported into module B
 * Another submodule of module A that is not imported into B exports a macro
 * Some submodule of module B also exports a definition of the macro, and
   happens to be the first submodule of B that imports module A.

In this case, we would incorrectly determine that A's macro redefines B's
macro, and so we don't need to re-export B's macro at all.

This happens with the 'assert' macro in an LLVM self-host. =(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213348 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Serialization/ASTReader.h
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/Modules/Inputs/macro-hiding/a1.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/a2.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/b1.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/b2.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/c1.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/module.modulemap [new file with mode: 0644]
test/Modules/macro-hiding.cpp [new file with mode: 0644]