aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-05-05 20:15:21 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-05-05 20:15:21 +0000
commitd8ffd0b7b61566f15a67192883a607f7703bcece (patch)
tree1589b51840a6db685aa0913ea7c019eef0f47e36 /lib/Sema/SemaDecl.cpp
parent287f24d3991994b9a263af9e2a873f4feadfb8fa (diff)
Make all 'is in extern "C"' tests use the lexical context.
I was not able to find a case (other than the fix in r181163) where this makes a difference, but it is a more obviously correct API to have. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index b5e2c6ebe8..8f78ead59e 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2246,11 +2246,9 @@ static bool haveIncompatibleLanguageLinkages(const T *Old, const T *New) {
return false;
LanguageLinkage OldLinkage = Old->getLanguageLinkage();
- if (OldLinkage == CXXLanguageLinkage &&
- New->getLexicalDeclContext()->isExternCContext())
+ if (OldLinkage == CXXLanguageLinkage && New->isInExternCContext())
return true;
- if (OldLinkage == CLanguageLinkage &&
- New->getLexicalDeclContext()->isExternCXXContext())
+ if (OldLinkage == CLanguageLinkage && New->isInExternCXXContext())
return true;
return false;
}
@@ -5153,7 +5151,7 @@ static bool mayConflictWithNonVisibleExternC(const T *ND) {
// This code runs before the init of foo is set, and therefore before
// the type of foo is known. Not knowing the type we cannot know its linkage
// unless it is in an extern C block.
- if (!DC->isExternCContext()) {
+ if (!ND->isInExternCContext()) {
const ASTContext &Context = ND->getASTContext();
if (Context.getLangOpts().CPlusPlus)
return false;