Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fix
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 14 Feb 2013 01:18:37 +0000 (01:18 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 14 Feb 2013 01:18:37 +0000 (01:18 +0000)
commitf4187658fa824f8f24ef578377ff6c174f527021
tree63b136d6bc5c88ec27f10ddc87734bd591873d36
parentb7444cd11ef1f688d91f0970f2615177af63916f
Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fix
some cases where functions with no language linkage were being treated as having
C language linkage. In particular, don't warn in

extern "C" {
  static NonPod foo();
}

Since getLanguageLinkage checks the language linkage, the linkage computation
cannot use the language linkage. Break the loop by checking just the context
in the linkage computation.

llvm-svn: 175117
clang/include/clang/AST/Decl.h
clang/include/clang/AST/DeclBase.h
clang/include/clang/Basic/Linkage.h
clang/lib/AST/Decl.cpp
clang/lib/AST/DeclBase.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/CodeGenCXX/c-linkage.cpp
clang/test/SemaCXX/function-extern-c.cpp
clang/test/SemaCXX/linkage2.cpp