[modules] Prefer more complete array types.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Sun, 28 Feb 2016 19:08:24 +0000 (19:08 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Sun, 28 Feb 2016 19:08:24 +0000 (19:08 +0000)
commit4d75e8d6761cb950b410d99fc09319bad51b14cb
tree375687cdc2021ffa691c12380c7e6c8351fdc3e3
parentdf0cd72657c898b1ed2b67c55b41459bc3ab5ab0
[modules] Prefer more complete array types.

If we import a module that has a complete array type and one that has an
incomplete array type, the declaration found by name lookup might be the one with
the incomplete type, possibly resulting in rejects-valid.

Now, the name lookup prefers decls with a complete array types. Also,
diagnose cases when the redecl chain has array bound, different from the merge
candidate.

Reviewed by Richard Smith.

llvm-svn: 262189
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaLookup.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/test/CXX/dcl.decl/dcl.meaning/dcl.array/p3.cpp
clang/test/Modules/Inputs/PR26179/A.h
clang/test/Modules/Inputs/PR26179/B.h
clang/test/Modules/Inputs/PR26179/basic_string.h