]> granicus.if.org Git - clang/commitdiff
Clear the LV cache when setting the instantiated from link.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 8 Jan 2013 14:58:32 +0000 (14:58 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 8 Jan 2013 14:58:32 +0000 (14:58 +0000)
Fixes pr14835.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171857 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/SemaCXX/visibility.cpp [new file with mode: 0644]

index 426e67cc79a0992c33c6e66ce7d2ad06aec81dd0..dc398f36ecd2829364f504be8f76b20ff6f10ffe 100644 (file)
@@ -949,6 +949,7 @@ ASTContext::setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl,
          "Already noted what static data member was instantiated from");
   InstantiatedFromStaticDataMember[Inst] 
     = new (*this) MemberSpecializationInfo(Tmpl, TSK, PointOfInstantiation);
+  Inst->ClearLVCache();
 }
 
 FunctionDecl *ASTContext::getClassScopeSpecializationPattern(
diff --git a/test/SemaCXX/visibility.cpp b/test/SemaCXX/visibility.cpp
new file mode 100644 (file)
index 0000000..434b3c0
--- /dev/null
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only %s
+
+namespace test1 {
+  template <class C>
+  struct C2
+  {
+    static int p __attribute__((visibility("hidden")));
+  };
+  int f() {
+    return C2<int>::p;
+  }
+}