aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-03-12 15:13:56 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-03-12 15:13:56 +0000
commit10b1d1cf5ebb14b672d6b0c88f5160ad3cf1e988 (patch)
treea1b90a311d385ee7e782570da34d814c0cfeaf45 /lib/Sema/SemaDecl.cpp
parent6c18af24456000e4b7289bc024519efdb796229a (diff)
Error if an extern C declaration matches a previous hidden extern C declaration.
Without this patch we produce an error for extern "C" { void f() { extern int b; } } extern "C" { extern float b; } but not for extern "C" { void f() { extern int b; } } extern "C" { float b; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176867 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 35af7b7264..252f94dc22 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5004,10 +5004,7 @@ void Sema::CheckShadow(Scope *S, VarDecl *D) {
template<typename T>
static bool mayConflictWithNonVisibleExternC(const T *ND) {
- VarDecl::StorageClass SC = ND->getStorageClass();
- if (ND->isExternC() && (SC == SC_Extern || SC == SC_PrivateExtern))
- return true;
- return ND->getDeclContext()->isTranslationUnit();
+ return ND->isExternC() || ND->getDeclContext()->isTranslationUnit();
}
/// \brief Perform semantic checking on a newly-created variable