]> granicus.if.org Git - clang/commit
Reinstate r284008 reverted in r284081, with two fixes:
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 14 Oct 2016 21:41:24 +0000 (21:41 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 14 Oct 2016 21:41:24 +0000 (21:41 +0000)
commit5b36200c3dc74e60f34e52fc71f2b1f71a61d5c0
treeaf8539c50b475a2d78a264c671cf27076464315b
parent80ec6606b51bca1eae70002ac45057694e8e3166
Reinstate r284008 reverted in r284081, with two fixes:

1) Merge and demote variable definitions when we find a redefinition in
MergeVarDecls, not only when we find one in AddInitializerToDecl (we only reach
the second case if it's the addition of the initializer itself that converts an
existing declaration into a definition).

2) When rebuilding a redeclaration chain for a variable, if we merge two
definitions together, mark the definitions as merged so the retained definition
is made visible whenever the demoted definition would have been.

Original commit message (from r283882):

[modules] PR28752: Do not instantiate variable declarations which are not visible.

Original patch by Vassil Vassilev! Changes listed above are mine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284284 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/AST/Decl.h
include/clang/Sema/Sema.h
lib/AST/Decl.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/SemaType.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriterDecl.cpp
test/Modules/Inputs/PR28752/Subdir1/b.h [new file with mode: 0644]
test/Modules/Inputs/PR28752/Subdir1/c.h [new file with mode: 0644]
test/Modules/Inputs/PR28752/Subdir1/module.modulemap [new file with mode: 0644]
test/Modules/Inputs/PR28752/a.h [new file with mode: 0644]
test/Modules/Inputs/PR28752/module.modulemap [new file with mode: 0644]
test/Modules/Inputs/PR28752/vector [new file with mode: 0644]
test/Modules/pr28752.cpp [new file with mode: 0644]