]> granicus.if.org Git - clang/commit
Fixed the AST importer ot use redeclaration contexts properly.
authorSean Callanan <scallanan@apple.com>
Wed, 10 Dec 2014 03:09:41 +0000 (03:09 +0000)
committerSean Callanan <scallanan@apple.com>
Wed, 10 Dec 2014 03:09:41 +0000 (03:09 +0000)
commit1691f14406d406a4552fcadb5a8022555368aa20
tree02c0c4fc521a73e7815f1b4825c6467ad0fad5aa
parent16badbf4df634e89bdfc69219093f02966809f80
Fixed the AST importer ot use redeclaration contexts properly.

To ensure that we don't import duplicates, the ASTImporter often
checks the DeclContext for a Decl before importing it to see if
a Decl with the same name is already present.

This is problematic if the Decl is inside a transparent context
like an extern "C" block.  Lookup isn't allowed on such contexts,
and in fact they assert() if you do that.  So instead we look at
the redeclaration context -- the containing context that can be
used safely for these kinds of checks -- instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223912 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ASTImporter.cpp