diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-02-14 01:47:04 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-02-14 01:47:04 +0000 |
commit | 5bda63f16bd4cc418319d760d1d7274f8c5101e3 (patch) | |
tree | 63d58ef1a32b40ffb32ebe49fc731fa6ad57e1ab /clang/lib/Sema/SemaDecl.cpp | |
parent | 7f999078bf24bf1c66fb6b66638856bd5e1b3e15 (diff) | |
download | bcm5719-llvm-5bda63f16bd4cc418319d760d1d7274f8c5101e3.tar.gz bcm5719-llvm-5bda63f16bd4cc418319d760d1d7274f8c5101e3.zip |
merge hasCLanguageLinkage and isExternC. Keep the shorter name.
I added hasCLanguageLinkage while fixing some language linkage bugs some
time ago so that I wouldn't have to check all users of isExternC. It turned
out to be a much longer detour than expected, but this patch finally
merges the two again. The isExternC function now implements just the
standard notion of having C language linkage.
llvm-svn: 175119
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 9c7fb6b4b21..d2b4697ee32 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -4860,7 +4860,7 @@ void Sema::CheckShadow(Scope *S, VarDecl *D) { template<typename T> static bool mayConflictWithNonVisibleExternC(const T *ND) { VarDecl::StorageClass SC = ND->getStorageClass(); - if (ND->hasCLanguageLinkage() && (SC == SC_Extern || SC == SC_PrivateExtern)) + if (ND->isExternC() && (SC == SC_Extern || SC == SC_PrivateExtern)) return true; return ND->getDeclContext()->isTranslationUnit(); } @@ -6581,7 +6581,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, // If this function is declared as being extern "C", then check to see if // the function returns a UDT (class, struct, or union type) that is not C // compatible, and if it does, warn the user. - if (NewFD->hasCLanguageLinkage()) { + if (NewFD->isExternC()) { QualType R = NewFD->getResultType(); if (R->isIncompleteType() && !R->isVoidType()) Diag(NewFD->getLocation(), diag::warn_return_value_udt_incomplete) |