When merging redeclaration chains across modules, if a declaration is visible
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 2 Aug 2013 01:09:12 +0000 (01:09 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 2 Aug 2013 01:09:12 +0000 (01:09 +0000)
commit7ecc31b0324c3bb99a41a12a7f19aada14c45012
treee1ed153ecaa413d903511d1db48eec9493c412f2
parentcdc78961d3ed71f0be7e8bf3b6f49efe342679a1
When merging redeclaration chains across modules, if a declaration is visible
in one module but is only declared as a friend in another module, keep it
visible in the result of the merge.

This is incomplete on two axes:

1) Our handling of local extern declarations is basically broken (we put them
in the wrong decl context, and don't find them in redeclaration lookup, unless
they've previously been declared), and this results in them making friends
visible after a merge.

2) Eventually we'll need to mark that this has happened, and more carefully
check whether a declaration should be visible if it was only visible in some
of the modules in which it was declared. Fortunately it's rare for the
identifier namespace of a declaration to change along its redeclaration chain.

llvm-svn: 187639
clang/include/clang/AST/Decl.h
clang/include/clang/Serialization/ASTReader.h
clang/lib/Serialization/ASTReaderDecl.cpp
clang/test/Modules/Inputs/cxx-templates-a.h
clang/test/Modules/Inputs/cxx-templates-b.h
clang/test/Modules/cxx-templates.cpp