]> granicus.if.org Git - clang/commit
Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 13 Aug 2013 18:18:50 +0000 (18:18 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 13 Aug 2013 18:18:50 +0000 (18:18 +0000)
commitdd9459f8869f66409f7ea429053b453e33f6499c
treea2da98d24ea77e1e6e0c76f8f793ab8fc1a5e072
parentf758bc7125d59bca12bb6c5f1d3c9025f395710e
Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:

When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).

 - Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
   set of cases, and make it track whether it found a shadowed declaration.
 - Track whether we found a declaration in the same scope (for C++) including
   across serialization and template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188307 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/AST/Decl.h
include/clang/Sema/Lookup.h
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriterDecl.cpp
test/CXX/basic/basic.link/p6.cpp
test/CXX/dcl.decl/dcl.meaning/dcl.array/p3.cpp [new file with mode: 0644]
test/PCH/cxx-templates.cpp
test/PCH/cxx-templates.h
test/Sema/extern-redecl.c
test/SemaCXX/function-redecl.cpp