Revert "Give external linkage and mangling to lambdas inside inline variables and variable templates."

To fix: runtime error: load of value 15, which is not a valid value for type 'clang::LVComputationKind'

This reverts commit r313827.

llvm-svn: 313856
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 77f20fa..c3e3de1 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -676,10 +676,10 @@
     if (!LV.isVisibilityExplicit()) {
       // Use global type/value visibility as appropriate.
       Visibility globalVisibility;
-      if ((computation & ~IgnoreTypeLinkageBit) == LVForValue) {
+      if (computation == LVForValue) {
         globalVisibility = Context.getLangOpts().getValueVisibilityMode();
       } else {
-        assert((computation & ~IgnoreTypeLinkageBit) == LVForType);
+        assert(computation == LVForType);
         globalVisibility = Context.getLangOpts().getTypeVisibilityMode();
       }
       LV.mergeVisibility(globalVisibility, /*explicit*/ false);
@@ -719,8 +719,7 @@
     //
     // Note that we don't want to make the variable non-external
     // because of this, but unique-external linkage suits us.
-    if (Context.getLangOpts().CPlusPlus && !isFirstInExternCContext(Var) &&
-        !(computation & IgnoreTypeLinkageBit)) {
+    if (Context.getLangOpts().CPlusPlus && !isFirstInExternCContext(Var)) {
       LinkageInfo TypeLV = getLVForType(*Var->getType(), computation);
       if (!isExternallyVisible(TypeLV.getLinkage()))
         return LinkageInfo::uniqueExternal();
@@ -760,8 +759,8 @@
     // unique-external linkage, it's not legally usable from outside
     // this translation unit.  However, we should use the C linkage
     // rules instead for extern "C" declarations.
-    if (Context.getLangOpts().CPlusPlus && !Function->isInExternCContext() &&
-        !(computation & IgnoreTypeLinkageBit)) {
+    if (Context.getLangOpts().CPlusPlus &&
+        !Function->isInExternCContext()) {
       // Only look at the type-as-written. If this function has an auto-deduced
       // return type, we can't compute the linkage of that type because it could
       // require looking at the linkage of this function, and we don't need this
@@ -1123,18 +1122,8 @@
   // calculation determines the lambda has external linkage, it should be
   // downgraded to VisibleNoLinkage.
   if (ContextDecl) {
-    auto *VD = dyn_cast<VarDecl>(ContextDecl);
     if (isa<ParmVarDecl>(ContextDecl))
       DC = ContextDecl->getDeclContext()->getRedeclContext();
-    else if (VD && VD->getType()->getContainedDeducedType())
-      // If the declaration has a deduced type, we need to skip querying the
-      // linkage and visibility of that type, because it might involve this
-      // closure type. The only effect of this is that we might give a lambda
-      // VisibleNoLinkage rather than NoLinkage when we don't strictly need to,
-      // which is benign.
-      return computeLVForDecl(
-          cast<NamedDecl>(ContextDecl),
-          LVComputationKind(computation | IgnoreTypeLinkageBit));
     else
       return getLVForDecl(cast<NamedDecl>(ContextDecl), computation);
   }