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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175117 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/c-linkage.cpp b/test/CodeGenCXX/c-linkage.cpp
index b1f07b7..a0a496d 100644
--- a/test/CodeGenCXX/c-linkage.cpp
+++ b/test/CodeGenCXX/c-linkage.cpp
@@ -11,3 +11,16 @@
 }
 
 // CHECK: define void @_ZN1N1X1fEv
+
+extern "C" {
+  static void test2_f() {
+  }
+  // CHECK: define internal void @_Z7test2_fv
+  static void test2_f(int x) {
+  }
+  // CHECK: define internal void @_Z7test2_fi
+  void test2_use() {
+    test2_f();
+    test2_f(42);
+  }
+}